Solved

Database Structure

Posted on 2009-07-07
4
338 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 27

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 27

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

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…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

718 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