5

I would like to generate a data only insert script within SSMS 2012 which contain the if not exists statements to make the scripts idempotent.

Right clicking the database I wish to generate the script for and selecting Tasks -> Generate Scripts the advanced scripting options within this wizard have been set as follows:

Setup of advanced options

When this wizard generates the SQL there are no IF NOT EXISTS checks:

INSERT [dbo].[Table] ([Column1], [Column2]) VALUES (N'Data1', N'Data2')

Am I missing something in the scripting options or is this not possible?

3
  • have you found a solution yet? I am facing a similar issue.
    – nozzleman
    Feb 26, 2015 at 6:07
  • @nozzleman I posted an answer to this problem. Jul 21, 2015 at 22:01
  • @AnotherDeveloper I do not see your answer. Can you please share once again?
    – 439
    Aug 29, 2017 at 3:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.