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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 SQL Script to build script of my database

Author  Topic 

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2008-06-04 : 11:46:07
Hi,
I'm sick of going into EM and selecting my database, going through the wizard, and saving my databases entire schema (tables,indexes, sproces etc) to a file.

Is there a way I can do this via tsql?

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-04 : 11:57:44
What!!!The script it generates is T-SQL.Thats the easiest way to script whole database structure.
Go to Top of Page

sql777
Constraint Violating Yak Guru

314 Posts

Posted - 2008-06-04 : 12:53:22
Sorry, what I mean is, is there a script I can use to generate the script (instead of using EM to generate the database script).
(basically, I can open up a new query window, paste this script and it will automatically save the newly generated database schema script to a file)

I want to store the script at c:\database\myscript.sql

Make sense?
Go to Top of Page

mdubey
Posting Yak Master

133 Posts

Posted - 2008-06-05 : 14:37:29
Once you generate the T-sql script you should be able to copy and save your file in any location.

Manoj
MCP, MCTS
Go to Top of Page
   

- Advertisement -