Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Query Editor SSMS 2008 R2 Strange Script Expand / Collapse
Author
Message
Posted Saturday, October 09, 2010 5:34 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, August 11, 2013 1:09 PM
Points: 80, Visits: 580
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---------'




Post #1001762
Posted Sunday, October 10, 2010 1:34 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, February 18, 2013 3:46 AM
Points: 1,422, Visits: 1,883
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.



Post #1001779
Posted Sunday, October 10, 2010 7:14 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Sunday, August 11, 2013 1:09 PM
Points: 80, Visits: 580
That did it

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.



Post #1001805
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse