Skip to content

Instantly share code, notes, and snippets.

@christierney402
Last active December 17, 2015 14:29
Show Gist options
  • Save christierney402/5625001 to your computer and use it in GitHub Desktop.
Save christierney402/5625001 to your computer and use it in GitHub Desktop.
SQL: Insert if not updated #snippet
UPDATE Table1
SET (...)
WHERE Column1='SomeValue'
IF @@ROWCOUNT=0
INSERT INTO Table1
VALUES (...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment