October 21, 2024
Chicago 12, Melborne City, USA
SQL

Send message to trigger


Is it possible to send a message that can be used in trigger code?

Something like

CREATE TRIGGER MyTrigger ON MyTable
AFTER INSERT
AS BEGIN
  INSERT INTO AnotherTable (Col, TheMessage)
  SELECT Col, TRIGGER_MESSAGE FROM inserted -- TRIGGER_MESSAGE contains 'Hey, its me'
END

INSERT INTO MyTable (Col) VALUES (1) TRIGGER_MESSAGE 'Hey, its me'



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video