Link to home
Start Free TrialLog in
Avatar of Brockstedt
BrockstedtFlag for United States of America

asked on

Copy SQL 2008 R2 Table Structure to different SQL 2008 Database

Good Day,

It has been asked for us to copy the current table structure of a development database (created in MS SQL 2008 R2) to a validation database which will also be MS SQL 2008 R2. They are not wanting the current data in the validation server, just the table structure.

I am not well versed in SQL, please keep answers in plain terms as much as possible :)

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In SSMS right-click on the desired table and chose "Script Tables as / CREATE TO / File"
I am assuming that you don't have a deployment script. In this scenario, one simple way would be script out all the objects from the database and run the script on the destination server. Here's a post that can help with the scriping: http://blog.sqlauthority.com/2011/05/07/sql-server-2008-2008-r2-create-script-to-copy-database-schema-and-all-the-objects-data-schema-stored-procedure-functions-triggers-tables-views-constraints-and-all-other-database-objects/

You should be able to follow most of the steps. When on the Types of data to script option, – select option to script only the schema (not "Schema & Data").
Avatar of Brockstedt

ASKER

Simpler than I thought it would be. I appreciate the assistance.

Thanks,

David