dcsimg
Login | Register   
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Enterprise
Expertise: Advanced
Aug 4, 2000

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


Using Distributed Queries on SQL Server 7.0

SQL Sever 7.0 allows developers to execute commands against OLE DB data sources on different servers. In order to execute commands on remote servers, the SQL Server instance where the commands will be issued must be setup properly. This entails adding the remote server to SQL Server's linked server list. Do this by using the sp_addlinkedserver command.

For example, to link a remote SQL Server database that resides on the RemoteDBServer server, you would use the following syntax:

 EXEC master. . sp_addlinkedserver 
@server = 'RemoteDBServer', 
@provider = 'SQLOLEDB', 
@srvproduct = 'SQL Server',
@datasrc = 'RemoteDBServer'
Note that only members of the sysadmin role can set this server option.

Once the remote database has been linked, queries can be executed against it—as long as the remote tables are prefaced using Server.Database.Table Owner.Table Name. For example, the following query would return all rows in the authors table of our RemoteDBServer SQL Server database:

 SELECT * FROM RemoteDBServer.pubs.dbo.authors
Andrew Holliday
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date