Home > SQL Server > Copy Database With Data – Generate T-SQL For Inserting Data From One Table to Another Table

Copy Database With Data – Generate T-SQL For Inserting Data From One Table to Another Table


Hi all,

Try this example to Copy Database With Data – Generate T-SQL For Inserting Data From One Table to Another Table

In our example, we will just take one table for convenience.

1- Open MS SQL Server 2008

2- Right Click on Database >> Tasks >> Generate Scripts >>

data1

3- This will pop up Generate SQL Server Scripts Wizards >> Click on Next >> Select Database >> This will bring up a screen that will suggest to Choose Script Option.

data2

data3

4- On Choose Script Option Screen of Script Wizard under section Table/View Options Look at Script Data row and Turn the Option to True.

data4

5- The Next Screen will ask about object types. Select all the objects that are required in the generated script. Depending on the previous screen it will show few more screen requesting details about the objects required in script generation.

data5

data6

6- On the very last screen it will request output options. Select the desired output options of Script to file, Script to Clipboard or Script New Query Window.3

data7

7- Clicking on Finish button will generate a review screen containing the required objects along with script generating data.

data8

data9

8- Clicking on Finish button one more time will generate the requested output.

data10

Hope this helps

Good Luck.

Advertisements
Categories: SQL Server
  1. No comments yet.
  1. No trackbacks yet.

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: