Automate Generate Scripts in SSMS

The SSMS allows you to manually generate scripts for a database by right-clicking a database and selected Generate Scripts and selecting what elements you wish to be scripted. However, suppose you do wish do manually perform this task, how can it be automated?

Actually there is no way to automate it from SSMS, currently the best way to do this without third party commercial tools is by using Scriptio (which uses the MS SMO API) and can act as an improved replacement for the database publishing wizard (sqlpubwiz.exe).

Scriptio has been released to CodePlex where there is a on how to compile for use with SQL Server 2008 and is available at http://scriptio.codeplex.com/

Alternatively you can purchase one of the Compare/Diff tools from SQL Server add-on vendors which can function as a more full-featured replacement of the sql publishing wizard. You can choose a database, backup, or snapshot as the source, and then select a folder as the output location and the tool will dumps everything into a folder structure.

 




Related Articles :

No comments yet... Be the first to leave a reply!

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |