views:

108

answers:

5

I need a tool that will look at a Microsoft SQL Server database and export the data as a SQL script. I want to be able to run the script on another box with an empty database and insert all the data from the previous one without having to muck with the index's due to ref-integ constraints.

+6  A: 

Try a tool like Red Gate Data Compare or DBGhost. Both have trials I believe.

http://www.innovartis.co.uk/

http://www.red-gate.com/products/sql%5Fdata%5Fcompare/index.htm

StarShip3000
+1 Nothing but good things to say about the Red Gate tools - excellent stuff!
marc_s
We use Red Gate too for backups. Awesome tools. Can't go wrong.
Wil P
I've used DbGhost for 10 years and it's never let me down. The support they provide is second to none
ip
+1  A: 

Depending on what version of SQL Server you have, you can right click the database, choose generate scripts, choose the tables you want, and uncheck the option to script structure and choose the option to script the data.

Raj More
+1  A: 

If you're using Visual Studio 2008 or above you should be able to script out the database when you do a publish of the website/web application. Scott Guthrie has a few examples of how to do this out of Visual Studio 2005: Deploying a Database Part I and SQL Server Database publishing kit.

Hope this works for you.

Chris
+1  A: 

I decided to go with ReadGate SQL Packager it create a very nice script for the entire DB or an exe that will install it if necessary

Jamey McElveen