Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 copy data from remote database

Author  Topic 

gary_gill
Starting Member

4 Posts

Posted - 2005-07-05 : 15:10:01
i have two tables with same name suppose x .one is at my local machine and another is at remote database suppoerse ip address is 192.168.1.20 how can i copy contents which r at remote database to my local databse

guru vb.net

jhermiz

3564 Posts

Posted - 2005-07-05 : 15:22:36
quote:
Originally posted by gary_gill

i have two tables with same name suppose x .one is at my local machine and another is at remote database suppoerse ip address is 192.168.1.20 how can i copy contents which r at remote database to my local databse

guru vb.net



Can you access that server via the network? Meaning does your PC see that PC? If so you should be able to add it in as a registered server. What about linked servers? Look them up in BOL.



Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page

gary_gill
Starting Member

4 Posts

Posted - 2005-07-05 : 15:33:26
quote:
Originally posted by gary_gill

i have two tables with same name suppose x .one is at my local machine and another is at remote database suppoerse ip address is 192.168.1.20 how can i copy contents which r at remote database to my local databse

guru vb.net



yes i do what next

guru vb.net
Go to Top of Page

ajthepoolman
Constraint Violating Yak Guru

384 Posts

Posted - 2005-07-05 : 16:08:07
quote:
Originally posted by gary_gill

i have two tables with same name suppose x .one is at my local machine and another is at remote database suppoerse ip address is 192.168.1.20 how can i copy contents which r at remote database to my local databse

guru vb.net




INSERT INTO YourTable
SELECT [ColumnList]
FROM OPENROWSET ( 'SQLOLEDB', 192.168.1.20' ; 'UserName' ; 'Password', 'select * from DatabaseName.dbo.TableName') as AliasName

I didn't test this, but it should be close to what you need.

Aj
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2005-07-05 : 16:10:22
You should read the topic "Importing and Exporting Data" in the SQL Server Books Online. It will outline the tools and options you can use.




CODO ERGO SUM
Go to Top of Page
   

- Advertisement -