Click here to Skip to main content
15,879,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

Is it possible to locate a table from other data server?
Instance   database name       table name
server1    dbWin               grGroup1

server2    dbCon               grGroup1



grGroup1 and grGroup2 has the same table structures but, grGroup1's records will be coming from grGroup2 which is located in another database server.

If its possible, How will i do this?
Posted
Updated 11-Jan-12 18:43pm
v2
Comments
Tejas Vaishnav 12-Jan-12 0:44am    
What you want, query the grgroup2 table from grgroup1 database or any thing else...
Alan Tuscano 12-Jan-12 0:52am    
its like this, table grGroup1 from server1 is newly created copying the same table structure from table grGroup1 located in server2. Table grGroup1 from server1 is empty and records to insert will be coming from grGroup1 located in server2.

I've done this;
SELECT * FROM server2.[dbCon].dbo.[grGroup1]

And this error appeared;
Msg 7202, Level 11, State 2, Line 1
Could not find server 'server2' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.

dbWin server is my local db server while dbCon Server is a database server i access on the network. I want to append records from gr1Group from dbCon Server into gr1Group located in dbWin server. is it possible?

Please show me how?

1 solution

You need to add link server then try
To add link server please go through the below link

http://msdn.microsoft.com/en-us/library/aa560998(v=bts.10).aspx[^]
 
Share this answer
 
Comments
Alan Tuscano 12-Jan-12 2:27am    
I just did this, but still an error appeared,

OLE DB provider "SQLNCLI" for linked server "VMSERVER" returned message "Login timeout expired".
OLE DB provider "SQLNCLI" for linked server "VMSERVER" returned message "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.".
Msg 53, Level 16, State 1, Line 0
Named Pipes Provider: Could not open a connection to SQL Server [53].
RDBurmon 12-Jan-12 2:30am    
Could you please share the steps used you have used ?
Alan Tuscano 12-Jan-12 19:59pm    
Using Sql Server 2005

1. I created a table "dlyGLAcc" in my local DEVELOPER04\MBWIN server.
In order for me to fill dlyGLacc with records, i need to access GLAcc from
another server(on Network named "VMSERVER\MBWIN").

Inside VMSERVER\MBWIN, belongs the databases PUSAN_USD_PROD and SEOUL_KRW_PROD,
inside the mentioned databases is a table name "GLAcc", that i need to access
and copy records from that table into dlyGLAcc which is in my Local
Server (DEVELOPER04\MBWIN).

2. I then registered VMSERVER\MBWIN and tested its connectivity and gave me a
"The Connection was tested Succesfully", and saved it.

But as i noticed, my local server(DEVELOPER04\MBWIN), has the green triangle
icon that means it is running, and the remote server(VMSERVER\MBWIN) has
a white circle.


How will access table GLAcc from the remote server(VMSERVER\MBWIN), inside
database PUSAN_USD_PROD and SEOUL_KRW_PROD.

I tried this code
select * from vmserver...glac

and resulted an error
OLE DB provider "SQLNCLI" for linked server "vmserver" returned message "Login timeout expired".
OLE DB provider "SQLNCLI" for linked server "vmserver" returned message "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.".
Msg 53, Level 16, State 1, Line 0
Named Pipes Provider: Could not open a connection to SQL Server [53].

RDBurmon 13-Jan-12 0:53am    
do you have window access to vmserver ? let me know because we have to do some server configuration . I will share the steps post your reply

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900