[dba-SQLServer]Generate Insert Statements

Arthur Fuller artful at rogers.com
Tue May 13 07:51:16 CDT 2003


While pondering how to write a sproc that would generate inserts, I came
across this wonderful chunk of code that does everything we could want.
Since it's a no-brainer to generate CREATE TABLE scripts, with this script
in hand, any and all of us can quickly generate a script enabling fellow
listers to create a database, the requisite tables, and some sample data.
Thus complex questions can be posed, along with a script to recreate the
gory details.

Get the generate-insers script here:
http://vyaskn.tripod.com/code/generate_inserts.txt. IMO it is a very slick
hunk of T-SQL.

Arthur



More information about the dba-SQLServer mailing list