Wednesday, 30 March 2011

Insert Trigger in SQL

CREATE TRIGGER Trigger1 ON job -- basetable
FOR INSERT
AS
INSERT INTO ClientInstruction (ClientOrganizationID,Summary,DateInstructed,ClientInstructionNo,jobid)
SELECT  ClientOrganizationID,InstructionComments, DateInstructed ,ClientInstructionNo,jobid
FROM INSERTED -- fetch from base table (data)

No comments:

Post a Comment