How can I automate the "generate scripts" task in SQL Server Management Studio 2008? -


I want to automate script generation in SQL Server Management Studio 2008.

Now what do I do:

  • Right click on My Databases, Tasks, "Generate Scripts ..."
  • Manually Manually select to select all export options from, and select all
  • Finally press the "Finish" button

Is it possible to automate this task? Any way? ?

Editing: I want to generate a creation script, do not want to change the script.

What is the Brian Visual Studio 2008 SP1 team suiting what is the version of the Database Publishing Wizard 1.4? Is installed with SQL Server 2008 (Professional only?) \ Program Files \ Microsoft SQL Server \ 90 \ Tools \ Publishing \ 1.4. VS call from server explorer is only calling this. You can get the same functionality as the command line:

  sqlpubwiz help script  

I do not know that there is only one problem in v1.4 v1. 1 done (users have been converted into role, barriers have not been created in the correct order), but this is not a solution for me because it does not have script for different files like Task-> Generated Scripts option in SSMS Does. I am currently using a modified version of scripio (uses MS SMO API) to work as a better replacement for the Database Publishing Wizard (sqlpubwiz.exe). It is not currently worth writing from the command line, I can add that contribution in the future.

Scriprio was originally posted on the blog of Bill Graziano, but later it was issued by the bill to codepex and was updated by others. To compile how to use SQL Server 2008, read the discussion to see it.

EDIT: I have started using Redgat's SQL product to do this since. This is a very good replacement for all SQL Publishing Wizards. You choose a database, backup, or snapshot as the source, and select the folder as the output location and it covers well in a folder structure, such a format is that their other product, SQL Uses the source control,


Comments