Sunday, March 20, 2005

sp_generate_inserts

Recently, I was doing some development where I created some new tables in the MSSQL database. I completed the task and needed a way to promote the tables (with data) to the QA database and eventually to production. Although it's certainly posssible to do this with DTS I wanted a simple text-based sql script to do the task as we have limited ability to create DTS jobs on production and it's easier to manage with source control. This is a trivial task to do with MYSQL but apparently not something that the MSSQL engineers thought about. Fortunately, a fellow named Vyas created a stored procedure sp_generate_inserts that does exactly what I need. When you run this proc against a table it creates a series of insert statements that repro the current data in that table.

0 Comments:

Post a Comment

<< Home