Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Copy records from one DB to another according to IP address

Posted on 2002-04-29
3
457 Views
Last Modified: 2009-07-29
HI,
How can I copy a whole table and some certain records from one DB to another.
The two DB are identical, but run under a diffrent Ip address.
I execute the SQL commands in MFC application, and connects the DB by ODBC connection.

I know the option of using "sp_addlinkedserver" , but I need to make the connection by IP adderess or by ODBC somehow.

meaning:
I dont want to let one server to know the registration name of the other server,however I want them to know each other by thier Ip Address.

I am using SQL Server 2000.

THanks in advance !!!
0
Comment
Question by:kukiya
  • 2
3 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6977480
sp_addlinkedserver also accepts IP addresses instead of Server Names.

Alternatives to sp_addlinkedserver would be the usage of OPENROWSET, which is however basically the same thing.

CHeers
0
 

Author Comment

by:kukiya
ID: 6977486
Thanks for the quick answer,
can you pls write me some code example ???!!!
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 100 total points
ID: 6977517
USE master
GO
EXEC sp_addlinkedserver
    '111.222.000.111',
    N'SQL Server'
GO
select * from [111.222.000.111].yourdb..remotetable

or:
SELECT a.*
FROM OPENROWSET('SQLOLEDB','111.222.000.111';'sa';'MyPass',
   'SELECT * FROM pubs.dbo.authors ORDER BY au_lname, au_fname') AS a
GO


Cheers

0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

807 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