views:

394

answers:

4

I have a SqlServer database that I've manually filled with some test data. Now I'd like to extract this test data as insert statements and check it in to source control. The idea is that other team members should be able to create the same database, run the created insert scripts and have the same data to test and develop on.

Is there a good tool out there to do this? I'm not looking for a tool to generate data as discussed here.

+1  A: 

EMS DB Extract for SQL Server (http://www.sqlmanager.net/en/products/mssql/extract) seems to do what you want, and it seems to be free.

Hope this helps,

Robin

robintw
+1  A: 

Red-Gate SQL Data Compare will do this. Just create a blank data base with the same schema, and run a compare against the original and the blank database. It will generate scripts to insert all of your test data.

jeremcc
+2  A: 

If you want a light-weight solution, I would recommend sp_generate_inserts. It is a store procedure you can create on your DB and pass in a variety of arguments to generate insert statements of all the data in the target table.

Steven Williams
A: 

This works http://www.sqlscripter.com/

New version of SQL Scripter (V2.1) was released last month.

Paul Rowland