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 comments:

Anonymous said...

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.

stephane said...

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

Post a Comment

Popular Posts