>Sql Server 2008 : Generate Data Script



(NOTE: There is no such facility in Sql Server 2005. But still you can create table data script http://connectsql.blogspot.com/2009/09/generate-tables-data-script.html)

Sql Server Management Studio 2008 provides easy approach to generate your data script. The resultant script will be in INSERT INTO statements format.

To achieve our goal, first right click on your desired database; select “Tasks”, then select “Generate Scripts …”

Click on your desired database name from given list and click “Next” button.
Next options page is import. Turn off all options except following and then click “Next” button
“Schema qualify object name” (for two part name i.e. schemaname0.tablename),
“Script USE DATABASE” (I will give an additional line of USE YourDatabaseName before your data script)
“Script Data” (To generate data script only)
Turn on check box of “tables” and click “Next” button

Select your desired tables or you can select all tables by click on SELECT ALL button, given on bottom of the page. Click “Next” button twice to continue.
Let it work till it generates success message. Click “Close” button to complete.

Posted on November 29, 2010, in Sql Server 2008, SSMS. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: