The only thing I don't have an automated tool for when working with SQL Server is a program that can create INSERT INTO
scripts. I don't desperately need it so I'm not going to spend money on it. I'm just wondering if there is anything out there that can be used to generate INSERT INTO scripts given an existing database without spending lots of money.
I've searched through SQL Server Management Studio Express with no luck in finding such a feature. If it exists in SSMSE then I've never found it.
Steps To Auto Generate INSERT StatementsFrom the right-click menu, go to Tasks >> Generate Scripts... In the Generate and Publish Scripts pop-up window, press Next to choose objects screen. Now, the choose objects screen, choose Select specific database objects and choose the tables you want to script.
Right click your database in your server, and select Tasks > Generate Scripts . At Introduction step, click Next. At Choose Objects, you can either select either the entire database (including functions, and etc) or specify what objects you want to generate.
This web site has many useful scripts including generating inserts.
You can utilise sp_msforeachtable
with it to generate for an entire DB.
Update: There is built-in functionality to script data as INSERTs in SQL Server Management Studio 2008(onwards).
SQL Server 2008:
Right-click on your database in SSMS, select Tasks –> Generate Scripts
, ensure your database is highlighted and click next. Scroll down the options list to the “Table/View Options” section, and change “Script Data” to True.
SQL Server 2012:
Right-click on your database in SSMS, select Tasks –> Generate Scripts
. Choose the tables you want to generate scripted INSERTs for, then click Next
. Choose where you want to send the output to (such as a new Query Window), and then click the Advanced
button (which for some reason is in the Save to File Section!). Scroll down the options list to the “Types of data to script” option and change it to either "Data only" or "Schema and data". Click Next
twice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With