临时变量赋值(NOLOCK)

时间:2017-06-16 15:49:31

标签: sql tsql variables nolock

在临时变量赋值中使用WITH(NOLOCK)是否有速度优势。含义:

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

经节

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

鉴于UPDATE,INSERT和DELETE语句https://docs.microsoft.com/en-us/sql/t-sql/queries/update-transact-sql不允许使用NOLOCK和READUNCOMMITTED。临时变量赋值是否符合此规则作为INSERT?

0 个答案:

没有答案