Guest User

trigger Price_TAB_Audit_trig

a guest
Nov 4th, 2015
144
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create trigger Price_TAB_Audit_trig on dbo.PRICE_TAB after insert, update, delete
  2. as
  3.  
  4. DECLARE
  5. @inserted XML,
  6. @deleted XML;
  7.  
  8. SELECT @inserted =
  9. ( SELECT * FROM inserted FOR XML PATH('row'), ROOT('inserted') );
  10.  
  11. SELECT @deleted =
  12. ( SELECT * FROM deleted FOR XML PATH('row'), ROOT('deleted') );
  13.  
  14. EXECUTE SendMsgServiceBroker 'ProcessPriceTabHistory', @inserted, @deleted;
RAW Paste Data