• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 501
  • Last Modified:

Export table structure and contents to .sql file

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
jasonbrandt3
Asked:
jasonbrandt3
  • 2
  • 2
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
take a full backup and restore it on the other servers
0
 
jasonbrandt3Author Commented:
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
 
Walter RitzelSenior Software EngineerCommented:
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
 
Aneesh RetnakaranDatabase AdministratorCommented:
its not so easy as in MySQL, and requires more processor resource
0
 
jasonbrandt3Author Commented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now