Looking for the script/tool to generate script for all databases creation

  • Is there any tool/script available to generate database creation script for all databases on a SQL instance?

    For SQL2000 EM, right click a database-->all tasks-->generate SQL script will get the script for that database. I am trying to generate the script for all the databases including the new database whenever is created, then schedule it to run on a regular basis.

  • Good utility. But it seems for generating database objects not database itself. I need to generate script for all databases on an instance.

    For example

    Create database mydb1 on (NAME = N'mydb1_Data', FILENAME …)

    go

    Create database mydb2 on …

    go

    When there is a need to rebuild a server, DBA should know how/where the databases to be created. Backup contains the DB objects already.

    If there are hundreds servers/databases, right clicking each database is not a good way.

  • Vivien, In S2K, if you right-click on the database from EM, select all tasks, select generate scripts then on the option tab, you can script the db, the database options, users and roles, among other things under the security options section. You will have to do it a database at a time.

    Edit - Sorry, should have read the original post, not just your subsequent reply :blush:

    -- You can't be late until you show up.

  • Right click...it works for one database and is a manual process. I need to get a script for all databases so I can automate/schedule it on a regular basis.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply