Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Script out database schemas

Author  Topic 

ranvir_2k
Posting Yak Master

180 Posts

Posted - 2010-01-14 : 05:06:07
Hi all,

I'm trying to write a script to script out the schemas for all the non system databases on a server.

I was wondering if someone can help me out on where to start.

Where is this information stored?

Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-14 : 05:08:17
http://www.nigelrivett.net/DMO/DMOScriptAllDatabases.html
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-14 : 05:09:18
or even this wizard

http://blog.sqlauthority.com/2007/08/21/sql-server-2005-create-script-to-copy-database-schema-and-all-the-objects-stored-procedure-functions-triggers-tables-views-constraints-and-all-other-database-objects/
Go to Top of Page

ranvir_2k
Posting Yak Master

180 Posts

Posted - 2010-01-14 : 05:36:33
Thanks, I'm looking to do this by script only so the wizard is out of question.

Also I only want to script out the Create Database schema so this script seems a bit too much as it scripts out all objects.

Do you know what table the create database schema is in, or a command I can run to get it from?
Go to Top of Page
   

- Advertisement -