Solved

Export table structure and contents to .sql file

Posted on 2009-05-05
5
494 Views
Last Modified: 2012-05-06
What is the easiest way to export a table structure and the data to a .sql script to be run on other servers.  I need to distribute this to another organizaton, I would like them to just run the script.  Is it possible to do this in SSIS?
0
Comment
Question by:jasonbrandt3
  • 2
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24308483
take a full backup and restore it on the other servers
0
 

Author Comment

by:jasonbrandt3
ID: 24308631
I realize I can backup the database and restore on the other servers.  What I want is a .sql script containing the table structure as in create table blah (.....)

with the data
insert into blah......

Hope that makes sense.  It's easily done in mysql by creating a dump file, I'd like to do something similar.
0
 
LVL 16

Accepted Solution

by:
Walter Ritzel earned 500 total points
ID: 24308659
If you are using SQL Server Management Studio, you can right click on the table, select menu Task and export the structure. Then, repeat the operation for the insert statements.
You can do both operations generate .sql files and use whenever you want.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24308690
its not so easy as in MySQL, and requires more processor resource
0
 

Author Comment

by:jasonbrandt3
ID: 24319387
Just wanted to add a last comment, MS actually makes a free product for just this task, it's called the database publishing wizard which allows you to create dump files.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

856 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