?
Solved

Export table structure and contents to .sql file

Posted on 2009-05-05
5
Medium Priority
?
497 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
[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
  • 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 2000 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

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

752 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