I have two databases with equivalent structure and I need to extract data from one of them in form of INSERT
statements (generate script to apply it on the other database).
How can I do it using Management Studio?
SSMS supports scripting all data as INSERTS in 2k8:
Right click on a database and select Tasks->Generate Scripts...
Pick only the tables, Click Next.
Click on the Advanced button. Scroll down and select "Types of data to script" == Data Only
Decide whether you want results in a new query window or a file. Click on to Finish.
You then change the using DBname
at the top of the script.
You can do it with SQL Server Management Studio. Here are the steps - as Mitch Wheat describes above (for SQL Server Management Studio 2012):
You will have a script file that contains both database schema and data.
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