Guest User

Untitled

a guest
Jan 19th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. Create TRIGGER [Billing].[Installments_InsertDeleteUpdate_History]
  2. ON [Billing].[Installments]
  3. AFTER INSERT, DELETE, UPDATE
  4. AS BEGIN
  5. Insert Into Billing_History.Installments
  6. Select *, GetDate(), 0 From Inserted
  7.  
  8. If Not Exists (Select * From Inserted)
  9. Insert Into Billing_History.Installments
  10. Select *, GetDate(), 1 From Deleted
  11.  
  12. SET NOCOUNT ON;
  13.  
  14. -- Insert statements for trigger here
  15.  
  16. Create TRIGGER [Billing].[Installments_InsertDeleteUpdate_History]
  17. ON [Billing].[Installments]
  18. AFTER INSERT, DELETE, UPDATE
  19. AS BEGIN
  20.  
  21. If Not Exists (Select * From Inserted)
  22. Insert Into Billing_History.Installments
  23. Select *, GetDate(), 1 From Deleted
  24. ELSE
  25. Insert Into Billing_History.Installments
  26. Select *, GetDate(), 0 From Inserted
  27.  
  28. SET NOCOUNT ON;
  29.  
  30. -- Insert statements for trigger here
Add Comment
Please, Sign In to add comment