Monday, December 5, 2011

Move Data from one server database to another server database(Import-Export utility))

Hello Friends,

Most of the time we have experienced that we need to move data from one Server(xxx) to another server(yyy).
For this we need to use Import-Export process from SSMS. This is good utility on SSMS to move data and just monitor it.

E.g. I got source server as xxx, source database as DB1 and i need to move data for particular table from this source to destination server(yyy),destination database DB2.

1. Connect to source server(xxx) go to database DB1 ad right click task->Export option.

It will open window to select source details :-

Select Server name -xxx
Database- DB1

use Authentication which is working on for server.
e,g, i am using here Windows authentication because i am having access on both server
click next




2.Choose destination data source ;-

 Select Server Name- yyy
Database -DB2

 click Next
Here you can see 2 options-
Copy tables from source to destination as it is
and write a query to select specific data from tables and put it in specific table




I will go with Option 1 as of now to move data from one table to destination table as it is

Select Option 1 and click Next.
You can see here that i am moving account table from source to Account table of destination databse.
If this Account table is not present on destination then it will create it automatically.
If you want to move table into already existing table then select table from destiantion table drop down.
Make sure soruce and destination table structure is same.You can also proview data which is moving to destination table.

Click Next-Click Next and Finish.
It will start moving data from soruce to destination.
At the end you can see all messages in Green color. And row count which is moved to destiantion table.

Hope this will help you in moving tables from one table to table instead of taking full backup and restoring it.

Will show you automated version of this process using SSIS package in next blog.







1 comment:

  1. Good work amit.
    Its good approach when we have to move small database.
    For large database just detach database & Copy to another server.Just attache it to new server. Its also transfer stored procedure,login,security rights & all.
    As this process is simple & accurate.

    ReplyDelete