Skip to content

Instantly share code, notes, and snippets.

@devmnj
Created May 14, 2019 17:07
Show Gist options
  • Save devmnj/ba37a15a0e79093ad61b102ab016fc6b to your computer and use it in GitHub Desktop.
Save devmnj/ba37a15a0e79093ad61b102ab016fc6b to your computer and use it in GitHub Desktop.
Insert new row if not exist - MSSQL
# This example SQL statement will allows to insert values only if not exist
# So that you can avoid duplication of data
If Not Exists(select * from emp where empcode='JA089')
Begin
insert into emp (empcode,name) values ('JA089','Jaseon Bourne')
End
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment