NOLOCK On CTEs

Erik Darling shows how the NOLOCK hint works with common table expressions:

So, for all you NOLOCKers out there, you can now save yourselves oodles of time by only using the hint in outer references to your CTEs and Views.

Congratulations, I suppose.

(Please stop using NOLOCK.)

Agreed, whenever possible.

Related Posts

New T-SQL Functions

Dennes Torres shows off four T-SQL functions releasing in SQL Server 2017: Translate Translate does the work of several replace functions, simplifying some queries. The function is called ‘Translate’ because its main objective: transform one kind of information in another by doing a bunch of replaces. For example: GeoJson and WKT are two different formats […]

Read More

Ditching IsNumeric()

Phil Factor on the IsNumeric() function: IsNumeric() is actually answering the question ‘Can this string be converted or ‘cast’ to a numeric datatype by SQL Server?’ It is pretty good at getting this answer right but it doesn’t tell you which datatype. It also isn’t interested in such things as overflow. This problem of IsNumeric() […]

Read More

Categories

March 2017
MTWTFSS
« Feb Apr »
 12345
6789101112
13141516171819
20212223242526
2728293031