Is it possible to write a select statement that also has NOLOCK
and TOP
in LINQ?
What about setting RowCount
before the query?
Is it possible to write a select statement that also has NOLOCK
and TOP
in LINQ?
What about setting RowCount
before the query?
Adding .Take(5) to your query is the same as Top 5
Adding .Skip(5) will start returning results on row 6
Not sure how you would add a NOLOCK to a query.
TGnat notes how to do TOP
(via .Take(n)
). However, there is no inbuilt way of adding granular hints (etc) like (NOLOCK)
to specific tables. There are a few ways of getting around this:
ExecuteQuery
with (parameterized) TSQL that has a NOLOCK
Of the 3, the UDF would get my vote:
.Skip
/.Take
/.Where
etc)