Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts 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: 824 | Views in the last 30 days: 1
 
Related Articles
FORUM

insert scripts

insert scripts

SCRIPT

Insert Script Generator

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

FORUM

Generate Insert script

Generate Insert script

FORUM

script for insert

script for insert

ARTICLE

Scripting INSERTs

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

 
Contribute