Few weeks ago I had to find a way to generate insert scripts for several database tables to populate those tables with data later (during the creation of new database instance). I haven't found any good solutions in Internet or any options at MS SQL Server Management Studio, so I decided to write my own Insert Script Generator...
It took me some hours to create a tool and some time to test it. Application is tested with Microsoft SQL Server 2005 (application have even generated scripts for 31000 rows). The process of generating insert scripts using my tool has three main steps:
- Enter connection string (or database login information)
- Select table (at this moment we can generate script only for one table at the same time)
- Push "Generate" button and enjoy the results (you can copy the results from textbox)
Here is a short list of some features:
- Tool can refresh the list of database tables using "Refresh tables" button
- Tool can use special date format for datetime/timestamp types. Date format can be entered using textbox on top. Help is provided.
- Generated scripts have copy to clipboard ability. Simply, push the right mouse button on textbox with results
- Tool sets IDENTITY_INSERT OFF/ON if table has IDENTITY columns
- Application uses DataSet to get insert scripts from
You can download the tool from those locations:
Feel free to contact me, if you have any questions regarding this tool.