By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,364 Members | 1,341 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,364 IT Pros & Developers. It's quick & easy.

MSSQL View SQL from GUI

P: 1
In Oracle, as I'm using the GUI to create tables, I can also look at older tables and the SQL it would take to create those tables again. Does MSSQL 2005 have this same feature anywhere in the Management Studio? I ask because I need to create a large number of tables that already exist in this database in a different place, so it would be nice if I could just view the script it would take to create these tables rather than having to write all the script from scratch myself. Any help would be appreciated.
Mar 21 '08 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
In Oracle, as I'm using the GUI to create tables, I can also look at older tables and the SQL it would take to create those tables again. Does MSSQL 2005 have this same feature anywhere in the Management Studio? I ask because I need to create a large number of tables that already exist in this database in a different place, so it would be nice if I could just view the script it would take to create these tables rather than having to write all the script from scratch myself. Any help would be appreciated.
Open Management Studio. Connect to your server. Go to your database. Expand Tables. Right Click on the table that you want. Choose CREATE to. Then choose where you want the script to go.

How many tables are we talking about? It might be faster if you just copy the database and truncate all the tables. Or go to the source database and do a

Expand|Select|Wrap|Line Numbers
  1. select * into newdb..newtable from olddb..oldtable where 1 = 2
-- CK
Mar 21 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.