Pages

Jun 12, 2014

Inserting Data in to a SQL Table from different Server.

Inserting Data in to a SQL Table from different Server.

We have different methods: I have used few of below
1)      Insert into script if there is Linked server created between the source and destination servers.

Execute below query from Source Server

insert into ServerName.DatabaseName.dbo.TableName
select * from dbo.TableName

2)       Impot/Export Wizard

Go to Start->All Programs-> SQL Server->Import and Export Data


Follow the below screenshots.



Choose the appropriate server and database in the above window and click next.


 Leave the default option and click next.


Select the table you want to export/Import and click on Edit mappings.
Check the button Drop and re-create destination table if you want.
You must check Enable identity Insert check box. Click Ok and Next.
Check the execution option you want to use on the below window and click next and next and Finish. You will see the error if any or it will load the data successfully.


No comments: