Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling stored procedures at a Trigger
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00434195
Message ID:
00434403
Views:
16
Yep,

You can pass an expression to an SP, I don't know why, it just doesn't like it! Change your code, and it will work fine!

IF UPDATE(myfield)
BEGIN
declare @secondfield typehere
set @secondfield = (SELECT mySecondField FROM INSERTED)
EXECUTE myStoredProc 1, @secondfield
END



>Hi,
>
>Anyone has made somthing like this, on a INSERT trigger:
>
>IF UPDATE(myfield)
>BEGIN
> EXECUTE myStoredProc 1, (SELECT mySecondField FROM INSERTED)
>END
>
>
>SQL Server return error at the "(".
>
>Any ideas?
>
>Thanks,
>
>Ricardo
Previous
Reply
Map
View

Click here to load this message in the networking platform