Solved

Database Structure

Posted on 2009-07-07
4
307 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
ID: 24799423
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
ID: 24799724
You can also use a tool like ApexSQL's SQLScript
www.apexsql.com
0
 
LVL 26

Expert Comment

by:Chris Luttrell
ID: 24799732
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
ID: 24800836
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

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 …
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

11 Experts available now in Live!

Get 1:1 Help Now