Solved

Database Structure

Posted on 2009-07-07
4
298 Views
Last Modified: 2012-05-07
hi

if i have a MS SQL 2008 database and i wanted to copy the structure without the data in it how can that be done ?

and is it possible to get the creation commands in a script file to run it inside an application ?
0
Comment
Question by:Pure_Heart
  • 2
4 Comments
 
LVL 26

Accepted Solution

by:
Chris Luttrell earned 250 total points
Comment Utility
In Management Studio, right click the database, then Tasks, then Generate Scripts.  That will get all the structure in the database but no data.  Creates a file you can save and use where you need to.
0
 
LVL 60

Expert Comment

by:chapmandew
Comment Utility
You can also use a tool like ApexSQL's SQLScript
www.apexsql.com
0
 
LVL 26

Expert Comment

by:Chris Luttrell
Comment Utility
If 3rd party tools are an option, I use and recommend Red Gate's SQL Compare to move/copy databases.
0
 
LVL 14

Expert Comment

by:Jagdish Devaku
Comment Utility
There is another good tool that i am using is SQL Delta...
www.sqldelta.com
The only thing you need to do before using this tool is.. you need to create a database on the target server.
...
Generating scripts might give you issues while creating the foreign key between the tables.
so i first suggest you to seperate the foreign key scripts from the main scripts file that is generated by Generating scripts from ssms. Now run the mail script file that dont foreign key scripts and then run the foreign key scripts.
...
check the below link which might help you...
http://www.karaszi.com/SQLServer/info_generate_script.asp
bye.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now