0 votes
1 view
in SQL by (20.3k points)

I have a Table (call it A_table) in a database (call it A_db) in Microsoft SQL Server Management Studio, and there are 10 rows.

I have another database (call it B_db), and it has a Table (call it B_table), which has the same column settings as A_table has. But the B_table is empty.

What I want:

Copy every row from A_table to B_table.

Is there any option in Microsoft SQL Server Management Studio 2012, to create an insert SQL from a table? Or is there any other option to do that?

1 Answer

0 votes
by (40.3k points)

Use the following steps to export all the data from the table to an insertable SQL format:

Step 1: Right-click on database

Step 2: Point to tasks. 

Step 3: Select the generate scripts

Step 4: Click on next >> Choose tables >> Click next >> Click advanced

Step 5: Now, scroll to data to script - i.e. called types of data to script in SMSS 2014.

Step 6: Select the data only. Click on 'Ok' to close the advanced script options window

Step 7: Click on next and generate your own script.

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...