Reputation: 1136
I wrote an AFTER INSERT
Trigger in my Azure SQL DB, which works just fine from within SSMS.
However, I am working with a JavaScript developer creating an application which writes to the Parent Table. The calling application needs to capture what was actually inserted. So, the Javascript statement is: Insert Into {my Table]... OUTPUT INSERTED.* Values (....
. The T-SQL OUTPUT
clause description specifically states "Triggers cannot be defined on the target."
Does anyone have suggestions for another way around this limitation? Do we have write a Procedure to query the Parent and Insert Into the Child?
Upvotes: 0
Views: 121
Reputation: 15648
DML statements cannot have any enabled triggers if the statement contains an OUTPUT
clause without any INTO
clause.
There's an article about this on the Microsoft SQL Programmability & API Development Team Blog.
Upvotes: 1