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.
Leave a Reply