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.
Naming SQL Server Instances So People Understand Them
Naming SQL Server Instances well clarifies default and named installs, survives growth, and makes later server renames less painful.
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.
SQL SERVER – PIVOT Table Example
A PIVOT Table example on AdventureWorks that counts addresses by state, plus why UNPIVOT cannot always give you back the original rows.
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.
Least Privilege for Application Logins
Design least privilege for SQL Server application logins with roles, schema permissions, and stored procedures, then test real workflows.







