Ceating Trigger
-
Hi All, Could you please let me know how to set up a trigger for the following senario? How could i setup a trigger to populate a back_up table every time i do an Insert on the master Table. //-------------------------------------------------------------- INSERT INTO [repor32].[dbo].[Master_table] SELECT * FROM [repor32].[dbo].[Back_up] WHERE [ADETDATE] NOT IN (SELECT [ADETDATE] FROM [repor32].[dbo].[Master_table]) Thank you
-
Hi All, Could you please let me know how to set up a trigger for the following senario? How could i setup a trigger to populate a back_up table every time i do an Insert on the master Table. //-------------------------------------------------------------- INSERT INTO [repor32].[dbo].[Master_table] SELECT * FROM [repor32].[dbo].[Back_up] WHERE [ADETDATE] NOT IN (SELECT [ADETDATE] FROM [repor32].[dbo].[Master_table]) Thank you
I'm not sure that I understand the scenario here. Is this the query that you will use in the trigger? or is the query that makes the insert in the master? amyway, check the CREATE TRIGGER[^] syntax from msdn
Hesham A. Amin My blog