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 2005 Forums
 Transact-SQL (2005)
 can we procedure to connect to different servers

Author  Topic 

sudha12345
Starting Member

47 Posts

Posted - 2009-04-24 : 07:29:46
can we write a procedure to connect to different servers and fetch the data. if it is possible can any one guide me

Sudhakar

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-04-24 : 07:48:41
There are several ways:

-Linked Servers
-Use OPENROWSET()
-Use OPENDATASOURCE()

These are all documented in Books Online, you'll need to read up on them to determine which one best suits your needs.
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-04-24 : 07:58:42
Linked Server is better option..


once Linked server is established..

then u can access table like


Select * from 172.16.3.225.pubs.mytable




Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled
Go to Top of Page

sudha12345
Starting Member

47 Posts

Posted - 2009-04-24 : 08:07:27
quote:
Originally posted by senthil_nagore

Linked Server is better option..


once Linked server is established..

then u can access table like


Select * from 172.16.3.225.pubs.mytable


how can we establish Linked server



Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled



Sudhakar
Go to Top of Page
   

- Advertisement -