Solved

Best way to move data from one server to another

Posted on 2013-01-02
7
334 Views
Last Modified: 2013-01-02
I need to make a copy of a data table residing on one server to a table on a different server.  I got into a session on machine_b and tried something like this:

SELECT * FROM machine_A.DB_Name.DBO.Table_name

But got this error message

Msg 7202, Level 11, State 2, Line 1
Could not find server 'machine_A' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.

The table is not huge,  If I could script out the data, I could copy and past the insert statements and that would work, but when I script the table, I just get its definition, not the data.  I'm in SQL Server 2005.  Any suggestions?

Thanks,

John
0
Comment
Question by:cipriano555
  • 3
  • 2
  • 2
7 Comments
 
LVL 13

Expert Comment

by:Yagya Shree
ID: 38738605
Create new table
move data of parent table to new table
create a new file group in existing table
rebuild cluster index or create primary key into new table [in that case your new table data will move to new file group, which you have recently created]
take a file group backup
restore it on your 2nd sql instance
0
 
LVL 13

Expert Comment

by:Yagya Shree
ID: 38738609
Export  and import table data into a excel file using DTS or SSIS package
0
 
LVL 22

Accepted Solution

by:
Steve Wales earned 500 total points
ID: 38738632
From SSMS, expand Databases, Right click on the database you want to import into, select tasks from the context menu and then import data...

From there you can specify server and DB from, server and DB to and the table(s) you want to copy.

Click through, click finish and done - it will do it all for you (make sure the target table is empty before you start though).
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:cipriano555
ID: 38738875
to yagyashree: my question is, how do you move that data?  I made a backup of the source database...but the backup goes to the source server....target server can't get to it (I don't know how to make it see it). So that won't do it....query that gives full path including server doesn't work (see error message in my post).

Yep, I can export the data to excel on the source machine...I think my question is more about getting data transfered from one machine to another than it is a database question...

To: sjwales I'll try that right now and see if I can do it.
0
 

Author Comment

by:cipriano555
ID: 38738889
BTW, I'm getting into SSMS.  There I have connections for the two servers, which I use to get to and work with databases on each.  I don't know how access the directory structures so that I could email export files to move them.  I know this is a really basic point to get stuck on, but I don't know how to even get into Windows Explorer and locate the file.  If I use windows explorer, I just see my local machine, I don't see either of the machines where the databases are located...I don't know how to find them.
0
 
LVL 22

Expert Comment

by:Steve Wales
ID: 38739029
I'm unclear from your last comment, did the import using the import/export wizard work ?
0
 

Author Closing Comment

by:cipriano555
ID: 38739059
You're a genius!  Worked like a charm and I didn't have to deal with transfering files.

John
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question