Scripting schema AND data with SSMS in SQL 2008

It's very commonly known that you can use the Script Wizard in Management Studio to script out tables or even an entire database. It's NOT commonly known that in SQL Server 2008, the wizard was upgraded and you can now script out the data too. The feature isn't enabled by default, which is why not many people know about it, and I couldn't find it described in Books Online either, further contributing to it's obscurity – but it's definitely there.

If you go into the wizard, and go down to the Table/View Options, there's a setting 'Script Data'. Set that to True and you'll get a bunch of INSERT statements in the resulting script too. Very cool.

Here's a screenshot showing what I mean (click it for a 1024×768 version).

 

Enjoy!

5 thoughts on “Scripting schema AND data with SSMS in SQL 2008

  1. Paul, that feature script data from script wizard options in SSMS 2012 was removed. You know the reason ? sorry for the question =^{

      1. It is not removed, just changed to “Types of data to script”, with options “Schema Only”, “Schema and data” and “Data only”.

Leave a Reply

Your email address will not be published. Required fields are marked *

Other articles

Imagine feeling confident enough to handle whatever your database throws at you.

With training and consulting from SQLskills, you’ll be able to solve big problems, elevate your team’s capacity, and take control of your data career.