SQL Server: Generic Sql Table Data Insert Script
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  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’
Here are a few other ways to accomplish the same:
- Generating INSERT statements in SQL Server by Sumit Amar.This is a windows based Dotnet application that generates insert statements for a given table.
- Generate Insert script to extract data by Rishikesh Singh. This style of generating insert statements is similar to my approach of generating error free and re-useable insert statements. This is a console based application build using C# 4.0