August 31, 2010 at 12:53 pm
Hi,
I have the stored proc that I am creating but recive an error :
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'END'.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER trigger1 ON test_tbl
FOR UPDATE
AS
UPDATE test_tbl
SET datechanged = getdate()
WHERE id in (SELECT i.id FROM Inserted i)
SET NOCOUNT ON;
END
Any idea why this will not create?
August 31, 2010 at 12:57 pm
You have an END without a BEGIN. Remove the END or add a matching BEGIN.
p.s. Shouldn't the NOCOUNT ON be before the update, not after?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
August 31, 2010 at 1:04 pm
Gail,
Your right I did looking review the code - thanks!
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply