Update Trigger to Increment a Version Number Column


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. CREATE TRIGGER [RobTestTrigger] ON [dbo].[RobTestTable]
  2. FOR UPDATE
  3. AS
  4. UPDATE t
  5. SET t.Version = t.Version + 1
  6. FROM RobTestTable t
  7. JOIN inserted i ON i.Id = t.ID

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.