Generating INSERT statements

When you are creating a SQL script to deploy your system, Enterprise Manager does a good job with all of the schema (creating the tables, views, etc…) but doesn’t handle creating INSERTS for any of your lookup tables. I used to generate SQL INSERT statements for my data using a SELECT (SELECT ‘INSERT …”‘ + [Col1] +'”…), but looking around on the web tonight, I found a cool stored proc that does all the work for you.

I actually found quite a few utilities to accomplish this same result, but this was the first one I tried and it worked great!

Author: Duncan Mackenzie

I'm the Developer Lead for the Channel 9 team, formerly worked on MSDN as a developer, content strategist and author.

Leave a Reply