How to create automatically a table populate script from current data in SQL Server?
17,567
Solution 1
Check out the SSMS Addins (for both SSMS 2005 and 2008):
One of the tools included in the "DataScripter" which will script out INSERT statements for the table(s) you want to.
Solution 2
Old question, but I got to the question before figuring out a way to solve the problem. So I'm just posting the method here in case it might help anyone else.
In SSMS:
- Right click on db -> "Tasks" -> "Generate Scripts..."
- Click "Next" and, at "Choose Objects" step, select the specific table
- Click "Next" and, at "Set Scription Options" step, click "Advanced"
- Set value for "Type of data to script", depending on what you need
- Continue to finish
Solution 3
Maybe this is just enough for you: http://snipplr.com/view/12003/generate-insert-statements/
Author by
Victor Rodrigues
Brazilian software developer, doing lots of Ruby code :D
Updated on June 16, 2022Comments
-
Victor Rodrigues almost 2 years
Is there a tool that allows me to create a sql populate script for a table using its current data?