Discussion:
Preparing Test Data to insert into Table
(too old to reply)
MS Techie
2009-02-11 15:27:02 UTC
Permalink
Hi Everybody,

In SQL Server 2005, I have some data in an SQL table. Now is there a way
that I can automatically generate the insert scripts which loads the data ,
just like I can automatically create the CREATE , DELETE scripts etc using
the SQL Management Studio. Is there a way I can achieve this ?

The reason I am doing this is probably this is a good way to generate test
data or for testing purpose. Any thoughts or suggestions would be appreciated.

Can I use a DTS Package or an SSIS to accomplish the same. I would be more
interested in using DTS or SSIS.

Thanks
tbradshaw via SQLMonster.com
2009-02-12 22:11:20 UTC
Permalink
MS Techie,

I don't think there's a straightforward way to do this.

If I had to generate test INSERTS, I would use a DTS data pump with ActiveX
scripting. For each row out, I would generate a line like this:
"INSERT TABLENAME(f1, f2, f3...)" & vbCRLF & "VALUES (" & f1 & ", " & f2 & ",
" & f3 .. & ")"

and dump it into a text file. Would this help you?

Let us know how you make out.

Regards,
Tom

Thomas Bradshaw
Data Integration Services
MyWebGrocer LLC
--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-dts/200902/1
Loading...