DECLARE @value BIGINT;
SET @value=2000
DECLARE @SQL NVARCHAR(1000)= N'SET LOCK_TIMEOUT ' + CAST(@value as Varchar(10)) + ' select @@Lock_TimeOUT';
print @SQL;
exec sp_executesql @SQL;
It is context specific. Context per database connection basis.
you can run that
SET LOCK_TIMEOUT 2000;
select @@Lock_TimeOUT
If you open a new connection(suppose open a new tab from management studio) then run
select @@Lock_TimeOUT
it will show difference result.