Restore Generated SQL Scripts Of Table With Records Into Another Database

Open SQL Server Management Studio.

SQL server

I have created a dummy database and table with some information.

query

Right click on the database, click tasks and generate scripts.

In this popup click next.

Click Generate scripts

Click Select specific database objects.

Select specific database

Select the table you want to generate scripts.

table

Click next.

Click single file per object.

Click Advanced tab.

Advance tab

Select Types of data to script will be “Schema and data".

If you need only Schema, then select Schema only.

Schema select schema

Click ok and next to complete.

Scripts has been generated successfully.

generated successfully

Now create another database to restore the table with records.

execute scripts

Now open the generateD script for the employee table.

Change the database name to test and execute scripts.

scripts

Click “F5” to execute.

Now the table has been created successfully with records.

records

Up Next
    Ebook Download
    View all
    Learn
    View all