Created
May 14, 2019 17:07
-
-
Save devmnj/ba37a15a0e79093ad61b102ab016fc6b to your computer and use it in GitHub Desktop.
Insert new row if not exist - MSSQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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