Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Copy all table designes from on Server to another

Posted on 2009-05-14
7
Medium Priority
?
250 Views
Last Modified: 2012-05-07
I want to copy all my table definitions for all my tables from one SQL Server 2005 to another SQL Server 2005.  I don't want the data copied.  How would I do this?

I can generate script for each table, copy it, and paste it into the new server's script window using the Server Management Studio.  There must be a better way?
0
Comment
Question by:schmir1
7 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24390215
You can generate entire table script and paste it on the other server's management studio
0
 
LVL 60

Accepted Solution

by:
chapmandew earned 1200 total points
ID: 24390293
open management studio, go to object explorer and navigate to the tables folder.  highlight all of the tables, right click and select script As...from there you can script to a file, new window, clipboard, etc.
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 400 total points
ID: 24391941
>>There must be a better way?<<
Yes, see here:
SQL Compare®
http://www.red-gate.com/products/SQL_Compare/index.htm
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 14

Assisted Solution

by:Jagdish Devaku
Jagdish Devaku earned 400 total points
ID: 24392412
generating the scripts will sometimes give an error while creating them back... like while adding foreign key relationships...
you can do onething ie. generate the scripts. seperate add foreign key relationship queries from the scripts...  and run the scripts seperately or if you want to execute everything in one click then add the foreign key relationship scripts below the create tables script.
or
we have third party tools which do this...
like red-gate (link given in the above post) & sql delta 4 (http://www.sqldelta.com/)
all the best... bye
 
0
 

Author Comment

by:schmir1
ID: 24484168
I got help from the server guy and he used SSIS.
0
 

Author Comment

by:schmir1
ID: 24484257
chapmandew:
  I tried this for future reference and it works great.  I had previously tried it using the Management Studio Object Explorer List (not the Object Explorer Details)  The list doesn't work but the Details does.  So now I know what good is the Details window.  Thanks a lot.
0
 

Author Closing Comment

by:schmir1
ID: 31581721
Thanks for your help.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question