Temp Variable Assignment WITH (NOLOCK)

373 Views Asked by At

Is there a speed benefit to using WITH (NOLOCK) in temporary variable assignment. Meaning:

This

DECLARE @oldestPerson INT = (SELECT TOP 1 Age FROM tbl_Persons)

Verses

DECLARE @oldestPerson INT = (SELECT TOP 1 Age FROM tbl_Persons WITH (NOLOCK))

given that NOLOCK and READUNCOMMITTED are not allowed for UPDATE, INSERT and DELETE statements https://learn.microsoft.com/en-us/sql/t-sql/queries/update-transact-sql. Does temporary variable assignment qualify under this rule as an INSERT?

0

There are 0 best solutions below