Вопрос по sql, sql-server – NOLOCK против уровня изоляции транзакции

19

Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededSupport for use of the READUNCOMMITTED and NOLOCK hints in the FROM clause that apply to the target table of an UPDATE or DELETE statement will be removed in a future version of SQL Server. Error: User Rate Limit ExceededNOLOCKError: User Rate Limit ExceededNOLOCKError: User Rate Limit ExceededREADUNCOMMITTEDError: User Rate Limit Exceeded RBT
Error: User Rate Limit ExceededNOLOCKError: User Rate Limit ExceededREADUNCOMMITTEDError: User Rate Limit ExceededSource. Jeroen

Ваш Ответ

4   ответа
21

SET Transaction...

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded Jason
1

6

4

.

:

SELECT can block updates. A properly designed data model and query will only cause minimal blocking and not be an issue. The 'usual' WITH NOLOCK hint is almost always the wrong answer. The proper answer is to tune your query so it does not scan huge tables.

If the query is untunable then you should first consider SNAPSHOT ISOLATION level, second you should consider using DATABASE SNAPSHOTS and last option should be DIRTY READS (and is better to change the isolation level rather than using the NOLOCK HINT). Note that dirty reads, as the name clearly states, will return inconsistent data (eg. your total sheet may be unbalanced).

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded

Похожие вопросы