Mssql update or insert

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

Copy this code and paste it in your HTML
  1. UPDATE MyTable SET FieldA=@FieldA WHERE KEY=@KEY
  3. IF @@ROWCOUNT = 0
  4. INSERT INTO MyTable (FieldA) VALUES (@FieldA)

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.