Query Editor SSMS 2008 R2 Strange Script

  • I just removed SQL Server 2008 Developer and installed SQL Server 2008 Developer R2.

    Ever since then if I try to script a stored procedure the procedure script returns bundled in a sp_executesql statement like the one below.

    I have never seen anything like this and can't find an option for this anywhere. Any advice is appreciated.

    EXEC dbo.sp_executesql @statement = N'--------Procedure Code---------'

  • You'll need to modify your SSMS settings.

    Go to Tools -> Options and in the left pane choose SQL Server Object Explorer -> Scripting.

    In the scripting options go to the "Object Scripting Options" section and set the "Include IF NOT EXISTS clause" to False. The dynamic SQL thingy comes up when this is set to True.

  • That did it :exclamationmark:

    Thank you very much it was driving me crazy. I had looked at that setting but did not have any idea that's what it did.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply