Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

nolocks on querys on remote servers

Status
Not open for further replies.

olemma

Programmer
Dec 21, 2001
43
US
Is there a way to run a SELECT query on a table ona remote server with something a NOLOCK? I need something to make sure the query doesn't lock the table.
 
This is an example of what I'm trying to run, but it fails:

select * from s1.d1.dbo.t1 (nolock) a, s1.d1.dbo.t2 (nolock) b where a.f1=b.f1
 
What does the message say? I assume it says, "Cannot specify an index or locking hint for a remote data source." This is NOT permitted. However, you can use the hint when using OpenQuery to execute the query on the remote server.

Select *
from openquery(server2,'Select Name From HR.dbo.employees (nolock) where EmpID=1432') Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Thanks Terry...it seems that it will work for what I needed for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top