Tuesday, February 20, 2007

Tool to generate script with SQL 2005

Just wanted to share this tool to create script files for any DB changes for SQL 2005 as this feature no longer exist with new version. http://www.sqlteam.com/publish/scriptio/

Here is comprehesive description regarding the same from one of my friends.

From: Ravindra Bisht
Sent: Monday, February 19, 2007 3:38 PM
Subject: Tool to generate script withSQL 2005

Microsoft Sql Server management studio does provide a elaborate Script wizard for generating script but it has only following options

- Script to file (which is one huge file with everything)
- Script to Clipboard
- Script to New Query Window

However two important features from SQL 2000 are missing:

1) One object per file.
2) A script that performs both DROP and CREATE.

Though MSDN documents indicates that this is possible here http://msdn2.microsoft.com/en-us/library/ms191299.aspx

However, it doesn't give any clue on how to accomplish it. Quote from that page:
"The schema for generated objects can be saved in a single SQL Script file , or in several files with each file containing
the schema of just one object."

And these above two features can be accomplish by tool that can be installed from http://www.sqlteam.com/publish/scriptio/

However the extension for all those files is .sql which can easily be modified.

Regards
Ravindra Bisht

1 comment:

Unknown said...

you might find this tool I wrote useful if you find yourself generating a lot of sql scripts. it’s useful for getting all your objects into source control if they aren’t already, or for implementing an autobuilder.

http://www.elsasoft.org/tools.htm