LucieLastic
Programmer
hi
Is it possible to call a stored proc from a Trigger? If so, I get a 'syntax error near keyword proc' and don't know why:
CREATE Trigger TempTrig
ON TempDil
FOR INSERT
AS
DECLARE @rows int --create variable to hold @@ROWCOUNT
select @rows=@@rowcount
if @rows = 0 --no rows inserted, so exit trigger
RETURN
EXEC proc spUpdateHistory(inserted.ID, inserted.Date, inserted.Factor)
-- Need to CATCH errors here
RETURN
Grateful for any help
lou
Is it possible to call a stored proc from a Trigger? If so, I get a 'syntax error near keyword proc' and don't know why:
CREATE Trigger TempTrig
ON TempDil
FOR INSERT
AS
DECLARE @rows int --create variable to hold @@ROWCOUNT
select @rows=@@rowcount
if @rows = 0 --no rows inserted, so exit trigger
RETURN
EXEC proc spUpdateHistory(inserted.ID, inserted.Date, inserted.Factor)
-- Need to CATCH errors here
RETURN
Grateful for any help
lou