Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Possible to copy table1 from database 1 server1 to another server ? 1

Status
Not open for further replies.

DebG

Programmer
Jun 29, 2000
4
US
Is it possible to move Table1 in Database1 on sever1 to Table2 in Database2 on server2?

I know that if it were on the same server you can do a bulk copy (insert into select...).

I have tried to use the data transfer utility. When it is finished I have a message box that says transfer completed with warnings and errors and I still don't have any data.

I have been working on this for 3 days and can't seem to get anywhere. HELP!!!!!!

[sig][/sig]
 
Assuming you can connect to both servers/databases at the same time, you should be able to do it via linked server, as in: [tt]insert into table2 select * from server..table1[/tt]. [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
What did I do wrong?
I typed:
insert into materials select * from LCS1.LCSBeta.materials.

when I ran it the error I got was: invalid object name 'LCS1.LCSBeta.materials'.

Does it matter that materials is on LCS.lcsbeta? [sig][/sig]
 
Assuming materials is on the current machine (the server you are initially logged into) and in the current database (USE the appropriate database), and you have LCS1 as a linked server (sp_addlinkedserver was run), then try:

[tt]insert into materials
[tab]select * from LCS1.LCSBeta.dbo.materials[/tt]
[sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Well now I am getting another error:
&quot;the object name 'LCS1.LCSBETA.DBO.Materials' contains more than the maximum number of prefixes. The maximum is 2.&quot; [sig][/sig]
 
You might as well create a DTS package to do it. It will keep all the indexes, triggers and other things, but in order to do this you must have exactly the same SQL Servers, e.g. you cannot transfer from Enterprise into Desktop but you can do it Desktop > Enterprise. [sig][/sig]
 
Why not bcp it out of one table, then bcp it in to the other. A bit laborious but it should work.
ck [sig][/sig]
 
In order for two servers to talk to each other, they must be linked. Otherwise, the server.catalog.owner.object connection won't work.

Once I linked my servers, it's not a problem.

HTH,

Mapman [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top