Creating Insert scripts in Sql Server 2008 R2
There were times when I wanted to experiment something in my project and needed a separate local DB with the real time data. It used to take lot of time to achieve it. but with Sql Server 2008 R2 management studio itself provides this feature handy.
This feature is built into the Generate Script utility, but the functionality is turned off by default and must be enabled when scripting a table.
Here are the steps to create Insert Data script using SQL Management Studio 2008 R2. You do not need any pugins or third party tools for this.
- Right Click on Database name like ‘Master’
- Select Tasks -> select Generate Scripts
- Next select the tables or object to which you want to generate script
- Go to set scripting options ,then click on advance button you find different options with catogories.
- In the General category: go to type of data to script
- we find 3 options for that
- Schema Only
- Data Only (really useful)
- Schema and Data
- Select the appropriate option and click on OK.
You will then get the create table statement and all of the INSERT statements for the data straight out of SSMS.
for a full discussion thread over this refer to the
For more insights refer to
Hope it helps!!