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

How to change how SSMS Scripting generates code Expand / Collapse
Author
Message
Posted Friday, November 7, 2008 10:27 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, October 20, 2014 9:15 AM
Points: 891, Visits: 1,553
Currently when I use SSMS 2005 to generate a CREATE script of an existing object by right-clicking the Object and selecting :

Script OBJECT As--->CREATE To

the resulting Query Window has a CREATE Object statement that uses the sp_executesql @statement SP where @statement is the complete T-SQL for creating the object. I want to get the script to not use the sp_ExecuteSQL SP but provide just the CREATE OBJECT T-SQL.

Is there anyway like a Scripting option in SSMS to get it to not use the sp_ExecuteSQL SP in the script it generates? I swear it use to generate scripts without using sp_ExecuteSQL and I don't know when this changed I just know I'd like to revert it back to the way it used to work.

NOTE: I have recently installed SQL Server 2008 (Tools & DB Engine) and kept my SQL 2005 DB Engine & Tools so I'm not sure if installing 2008 perhaps made some change that affected 2005 tools.

Thanks


Kindest Regards,

Just say No to Facebook!
Post #599128
Posted Friday, November 7, 2008 10:31 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 9:14 AM
Points: 9,294, Visits: 9,483
Typically, the Scripter has to use Dynamic SQL like this when the "Include IF NOT EXISTS" option is set.

Turn that off and you should see hardly any dynamic SQL in your scripts.


-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #599131
Posted Friday, November 7, 2008 12:11 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, October 20, 2014 9:15 AM
Points: 891, Visits: 1,553
Setting Include IF NOT EXISTS clause to False did the trick.

Thanks!


Kindest Regards,

Just say No to Facebook!
Post #599219
Posted Friday, November 7, 2008 12:49 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Wednesday, October 15, 2014 9:14 AM
Points: 9,294, Visits: 9,483
Glad I could help!

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #599239
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse