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 2008 Forums
 Transact-SQL (2008)
 Query remote database from T-sql

Author  Topic 

rodrigue.alahassa
Starting Member

1 Post

Posted - 2011-03-14 : 12:13:30
Hi,

I'm looking for T-sql statements to query a remote database. That includes remote connection to sql server and query on tables of a specific database.

Hope someone could help.

Thx in adavance

… the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-03-14 : 14:01:28
You can use a linked server or OPENQUERY to make a remote connection from within the local database server. But performance will likely suffer.

But I'm not quite clear on your config. Do you want to make a remote query from within the local database server or is your application going to do it?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -