August 6, 2016 at 4:30 am
hi,
which one is good way of putting nolock
other think is
Omitting the WITH keyword is a deprecated feature: This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
above was given in https://msdn.microsoft.com/en-us/library/ms187373.aspx
is it applicable to single hints also.
1) select * from customer cus(nolock)
join salesorder s(nolock) on cus.custid = s.custid
2) select * from customer(nolock) cus
join salesorder(nolock) s on cus.custid = s.custid
yours sincerley
August 6, 2016 at 8:18 am
Answer withdrawn because I prefer not to help people with interview questions.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
August 6, 2016 at 9:40 am
rajemessage 14195 (8/6/2016)
hi,which one is good way of putting nolock
other think is
Omitting the WITH keyword is a deprecated feature: This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
above was given in https://msdn.microsoft.com/en-us/library/ms187373.aspx
is it applicable to single hints also.
1) select * from customer cus(nolock)
join salesorder s(nolock) on cus.custid = s.custid
2) select * from customer(nolock) cus
join salesorder(nolock) s on cus.custid = s.custid
yours sincerley
My question is why use nolock? Do you understand what it means?
😎
August 6, 2016 at 10:47 am
rajemessage 14195 (8/6/2016)
hi,which one is good way of putting nolock
other think is
Omitting the WITH keyword is a deprecated feature: This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.
above was given in https://msdn.microsoft.com/en-us/library/ms187373.aspx
is it applicable to single hints also.
1) select * from customer cus(nolock)
join salesorder s(nolock) on cus.custid = s.custid
2) select * from customer(nolock) cus
join salesorder(nolock) s on cus.custid = s.custid
yours sincerley
Neither. The use of the NOLOCK hint is most stupid and can play hell with data and the application. People use it to try to overcome performance problems that shouldn't exist to begin with.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 6, 2016 at 3:15 pm
Talking about interviews, I did one last week. The question that tipped the interview from 'maybe' to 'no' was when I asked about the cause of deadlocks and he replied that deadlocks were caused when multiple people queried the same table without using the nolock hint.
So, if this is an interview question, maybe it's a trick question and you're supposed to react with horror and explain why you'd never use nolock so broadly.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply