Monday 15 June 2015

sql - Why is WITH required when using NOLOCK on a remote table call? -


I went to an issue today, which is to reach a remote table using the NOLOCK Attempting I found this error:

  Remote table-value function call is not allowed   

On turning this problem, I found out Adding with (NOLOCK) fixes the problem I'm wondering why

SQL: ... Choose

  with [D.B1] [dbo] [REMOTE_TABLE] from [LINKED_SRV] (NOLOCK)    

< Quote after div class = "citation" itemprop = "text">

:

Important

Keywords together Excluded is an exclusion feature: This feature will be removed in the future version of Microsoft SQL Server. Avoid using this feature in new development work, and applications that are currently planning to modify the use of this feature

The following table is indicated with the indication and without permission with:. NOLOCK, READUNCOMMITTED, UPDLOCK, REPEATABLEREAD, serializable, READCOMMITTED, TABLOCK, TABLOCKX, PAGLOCK, ROWLOCK, NOWAIT, READPAST, XLOCK, and NOEXPAND. When these table signs are specified without the keyword, the signals should be specified alone.

The document states that for your attempted query, permission to remove the keyword with is allowed. Based on that, I would consider it a bug though, the documentation has also been said that this feature is inappropriate and will be removed in the future version of SQL Server, then you should not expect this change in the bug documentation. Apart from the other way to be decided.

I suspect that the parser sees the server. Database.schema.table () and it decides that this is a user-defined function, so there is an error, and sometimes Does not even go to that point where it sees that NOLOCK is not a function argument.

No comments:

Post a Comment