Caveman's Blog

My commitment to learning.

Archive for the ‘Data Script’ Category

SQL Server: Generic Sql Table Data Insert Script

Posted by cavemansblog on January 28, 2008

woah!!

I have my own blog and this is my first posting. hurray…. I have been shying away from doing this for a long time now… finally pulled all my energies to start blogging tech stuff that I learn …

There is so much that I learn and so much I forget all the time…. It is getting really tough to keep track of all that I have learned…. I hope I can keep up with posting useful stuff that I learn.

enough of my preamble now… cutting the chase and getting to my post…

How many time must I have thought ” I wish I had a script that I would run with the table name as an argument and get insert statements for all the data in a Sql Server 2000/2005 table.” Thanks to Narayana Vyas Kondreddi, I have got a script [1] that does exactly what I want. This is a cool utility that is very handy.

To generate INSERT statements for table ‘titles’:
EXEC sp_generate_inserts ‘titles’

References:
1. http://vyaskn.tripod.com/code.htm#tagit

Posted in Data Script, Sql Server, Sudheer Reddy Battula | Tagged: , | Leave a Comment »