UNPIVOT Table is the reverse of PIVOT. This AdventureWorks example turns state columns back into rows, and shows why the detail rows do not return.
SQL SERVER – SQL SERVER – UDF – Get the Day of the Week Function – Part 3
Nanda Kumar improved the UDF to get the day of the week: it now uses the date you pass in instead of GETDATE() and handles Saturday correctly.
SQL SERVER – T-SQL Script to Devide One Column into Two Column
A quick script to split one column into two with LEFT, RIGHT and CHARINDEX, plus what to check when a value has no comma or has extra spaces.
SQL SERVER – SQL SERVER – UDF – Get the Day of the Week Function – Part 2
Mihir Popat improved my Day of the Week Function with @@DATEFIRST, so Sunday does not have to be the first day of the week. Here is his UDF.
STRING_ESCAPE JSON Text: Escaping Is Not Serialization
STRING_ESCAPE JSON text is still text that belongs inside a JSON string. This example compares quotations, backslashes and a newline with complete FOR JSON PATH objects.
Bit Shifts: Move Bits Without Rotating Them
Bit shifts fill vacant positions with zero and discard bits past the type width. Compare tinyint with int and a negative shift direction.
SQL SERVER – Function Property – Deterministic or Non-Deterministic
How do you tell if a user defined function is deterministic or non-deterministic? One OBJECTPROPERTY call with IsDeterministic gives you the answer.







