Hello.
I have the following code in a SQL trigger:
I want to add the deleted records to this too, but my code below just overwrites the @XML variable. How do I add to it?
Many thanks in advance,
Pete
There's a thin line between genius, and insanity!
I have the following code in a SQL trigger:
Code:
SELECT @XML = SELECT * FROM inserted FOR XML PATH ('MyEntity'), ELEMENTS, ROOT('Inserted'), TYPE);
I want to add the deleted records to this too, but my code below just overwrites the @XML variable. How do I add to it?
Code:
SELECT @XML = SELECT * FROM deleted FOR XML PATH ('MyEntity'), ELEMENTS, ROOT('Deleted'), TYPE);
Many thanks in advance,
Pete
There's a thin line between genius, and insanity!