Using NOLOCK for Remote Database for faster queries

If we “Server1” Database Production Server with:

Database:Production

Table: Inventory

And we run in “Server1”:

SELECT *
FROM dbo.Inventory (NOLOCK)

It will run fine.

But if we have another production database server “Server2” with:

Database:Production2

Table:Inventory2

And we try to get all data from “Server1” by using:

SELECT *
FROM Server1.Production.dbo.Inventory (NOLOCK)

It will fail with error: No Remote Function call is allowed.

Solution:

SELECT *
FROM Server1.Production.dbo.Inventory WITH (NOLOCK)

 

Funther Explanation what NOLOCK is found here: http://www.mollerus.net/tom/blog/2008/03/using_mssqls_nolock_for_faster_queries.html

Advertisements
By simplemsexchange Posted in SQL 2008

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s