Skip to content

Instantly share code, notes, and snippets.

@abcdeepakr
Last active March 10, 2023 05:37
Show Gist options
  • Save abcdeepakr/bef832be81b1b6bd0e6028fcd1095a16 to your computer and use it in GitHub Desktop.
Save abcdeepakr/bef832be81b1b6bd0e6028fcd1095a16 to your computer and use it in GitHub Desktop.
if exists(SELECT * from [dbo].[tbl_name] where id='my_id')
begin
update [dbo].[tbl_name] set column_name='${value}' where id='my_id'
end
else
begin
insert into [dbo].[tbl_name] values('val_1','val_2','val_3,...')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment