Hello,
Was wondering if you could help me with a problem.
I wish to create a stored procedure which creates a trigger and a stored procedure that drops a trigger. I realise I can incorporate both into the one procedure but I cannot get past the first step of creating a trigger.
Within Enterprise Manager I get the following message
Error 156: Incorrect syntax near keyword TRIGGER
when I hit Check Syntax button
Here is the Create procedure
Create procedure [dbo].[sp_CreateTrigger] As
Create Trigger [trg_myTrig] On [dbo].[myTable]
After Insert, Update
As
Print 'Hello World'
Return
I was wondering if I have to encapsulate the trigger statement with something? I eventually pruned the trigger contents down to the simple print statement with no success. I have dug around quite a bit but have found no similar problems or examples for that matter. Can someone offer some light on this?
Thank you in advance
Anthony
Thank you in advance
Was wondering if you could help me with a problem.
I wish to create a stored procedure which creates a trigger and a stored procedure that drops a trigger. I realise I can incorporate both into the one procedure but I cannot get past the first step of creating a trigger.
Within Enterprise Manager I get the following message
Error 156: Incorrect syntax near keyword TRIGGER
when I hit Check Syntax button
Here is the Create procedure
Create procedure [dbo].[sp_CreateTrigger] As
Create Trigger [trg_myTrig] On [dbo].[myTable]
After Insert, Update
As
Print 'Hello World'
Return
I was wondering if I have to encapsulate the trigger statement with something? I eventually pruned the trigger contents down to the simple print statement with no success. I have dug around quite a bit but have found no similar problems or examples for that matter. Can someone offer some light on this?
Thank you in advance
Anthony
Thank you in advance