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 123»»»

How to Get the Scripts for SQL Server Objects Expand / Collapse
Author
Message
Posted Tuesday, March 24, 2009 11:20 PM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, November 11, 2014 1:02 PM
Points: 57, Visits: 138
Comments posted to this topic are about the item How to Get the Scripts for SQL Server Objects

http://ozkary.blogspot.com
http://og-bit.com
Post #683045
Posted Wednesday, March 25, 2009 1:16 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, December 8, 2014 6:26 PM
Points: 942, Visits: 1,069
Thanks for article, I had found something similar at CodePlex, Link.

Only thing about CodePlex version was I couldn't get it to script out only the objects I wanted. So using DMO can give us that flexibility. Thanks.


---

Mohit K. Gupta, MCITP: Database Administrator (2005), My Blog, Twitter: @SQLCAN.
Microsoft FTE - SQL Server PFE

* Some time its the search that counts, not the finding...
* I didn't think so, but if I was wrong, I was wrong. I'd rather do something, and make a mistake than be frightened and be doing nothing.


How to ask for help .. Read Best Practices here.
Post #683092
Posted Wednesday, March 25, 2009 3:29 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 21, 2012 7:40 AM
Points: 26, Visits: 84
Why is the script called with cscript rather than wscript?
From Technet:
Using the command-based script host (CScript.exe)

Cscript.exe is a command-line version of the Windows Script Host that provides command-line options for setting script properties.

With Cscript.exe, you can run scripts by typing the name of a script file at the command prompt. Like Microsoft Internet Explorer, Windows Script Host serves as a controller of Windows Script compliant scripting engines, but Windows Script Host has very low memory requirements. Windows Script Host is ideal for both interactive and non-interactive scripting needs, such as logon scripting and administrative scripting.

Windows Script Host supports scripts written in VBScript or JScript. When you start a script from your desktop or from the command prompt, the script host reads and passes the specified script file contents to the registered script engine. The script engine uses file extensions (that is, .vbs for VBScript and .js for JScript) to identify the script. As a result, you do not need to know the exact programmatic identifier (that is, the ProgID) of the script engine. The script host maintains a mapping of script extensions to programmatic identifiers, and uses the Windows XP association model to start the appropriate engine for a given script. For more information about Windows Script Host, see Windows Script Host For more information about CScript.exe, see To run scripts using the command-line-based script host (cscript.exe)
Post #683136
Posted Wednesday, March 25, 2009 5:29 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, November 22, 2011 8:44 AM
Points: 395, Visits: 275
To be fair, I have not read your article, but I did notice that it uses DMO which is being replaced by SMO. We have found that although DMO does a fair job in SQL 2005, it does not script out everything as expected in SQL 2005 (e.g., jobs, varchar(max), etc.).

Aaron
Post #683196
Posted Wednesday, March 25, 2009 5:33 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, November 22, 2011 8:44 AM
Points: 395, Visits: 275
To be fair, I have not read your article, but I did notice that it uses DMO which is being replaced by SMO. We have found that although DMO does a fair job in SQL 2005, it does not script out everything as expected in SQL 2005 (e.g., jobs, varchar(max), etc.).

Aaron
Post #683204
Posted Wednesday, March 25, 2009 7:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, October 26, 2012 10:31 AM
Points: 8, Visits: 30
For scripting all your SQL objects to a Visual Studio Database project, you should do a Google search for "DbFriend".
Post #683270
Posted Wednesday, March 25, 2009 7:22 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, October 26, 2012 10:31 AM
Points: 8, Visits: 30
For scripting all your SQL objects to a Visual Studio Database project, you should do a Google search for "DbFriend".
Post #683278
Posted Wednesday, March 25, 2009 7:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, October 26, 2012 10:31 AM
Points: 8, Visits: 30
For scripting all your SQL objects to a Visual Studio Database project, you should do a Google search for "DbFriend".
Post #683286
Posted Wednesday, March 25, 2009 7:31 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, December 15, 2014 1:02 PM
Points: 1,414, Visits: 4,545
why use this instead of SSMS to script everything out?

https://plus.google.com/100125998302068852885/posts?hl=en
http://twitter.com/alent1234
x-box live gamertag: i am null
[url=http://live.xbox.com/en-US/MyXbox/Profile[/url]
Post #683287
Posted Wednesday, March 25, 2009 7:48 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, October 26, 2012 10:31 AM
Points: 8, Visits: 30
I use DbFriend for:
- clean organization (I can put my files anywhere on disk, not just where SMSS says).
- clean, repeatable scripts (SMSS script options are many and if I forget to check/uncheck an option, all my scripting time is wasted)
- comparing against Production (again, clean scripting makes this a reliable DIFF)
- DATABASE FIND & REPLACE
- working in my environment of choice (VS 2008)
- encourages me to THINK about my SQL assets as compiled code, that I have to RUN against a SQL box first, then exercise using SMSS (and with dual monitors, this is a very fluid workflow)
Post #683308
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse