Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favourite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved in your SSC briefcase from the favorites tab.
Download now (direct download link)

Generate Insert Statements

By Jason Scott Kelley,

If you wish to save the contents of your database as insert statements, this script will generate a text file that has all data formatted as insert statements. This way you can save off the data as a script to send to a client or combine with a create script to rebuild the database on another server. To Use:

1.Open script in Query Analyzer.
2.Change output to file.
3.Configure the section at the top to include tables you are interested in.
4.Run the script.

The file will contain a script which can be run to insert the records into a database with the same table structure. There is a small script commented out at the top of this script which will automatically generate number 3 for you.

Total article views: 822 | Views in the last 30 days: 2
Related Articles

insert scripts

insert scripts


Insert Script Generator

The following SP helps create the insert script for all tables or specified tables within a database...


Generate Insert script

Generate Insert script


script for insert

script for insert


Scripting INSERTs

A little procedure to quickly product a script for copying data from one database to another.


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones