Generate the code to recreate all non system databases in MSSQL without content.

The following text will output the SQL statement to recreate all databases:

select 'create database [' + name + ']
go' from master..sysdatabases
Where DBID > 4

You will need to set Results to Text so that the output is correctly formatted. You can then copy users/logins as seen here: http://support.microsoft.com/kb/918992.


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *