SQL Server 2008:- Insert Script with DATA


If we want to generate Insert Script with data values, it was not possible before SQL Server 2008.
Now SQL Server 2008 support insert script with data also.

Here are steps for it

1. Right click on database, select task -> generate scripts

2.Follow the wizard , select DATABASE

3.In the choose script options, select Table View Options -> script data

Follow remaining options.

The script generated by wizard will have insert script with data.

2 Responses to “SQL Server 2008:- Insert Script with DATA”

  1. Unknown's avatar Anonymous Says:

    I saw this post very helpful for generating SQL Insert statements from an existing database table with options to filter and sort the output data. It works for IDENTITY columns also. It allows you to pass as parameters the SQL tableName, whereClause to filter data and orderByClause to order the data the way you want. Hope it may be useful to others as well.

  2. Unknown's avatar stephane Says:

    Under sql server 2008, set "Types of data to script" to "Data Only"

Leave a reply to Anonymous Cancel reply


Design a site like this with WordPress.com
Get started