Get the day of the week as a name in SQL Server: a UDF using DATEPART with CASE, plus the simpler DATENAME(dw, GETDATE()) a reader suggested.
SQL SERVER – Validate Field For DATE datatype using function ISDATE()
A CSV import crashed on the date 30/2/2007. Use the ISDATE() function to validate a VARCHAR column in a staging table before moving rows to a DATETIME field.
SQL SERVER – 2005 – List All Stored Procedure Modified in Last N Days
A query on sys.objects to list every stored procedure modified in last N days, or ones created lately. I use 7 days; change it to what you need.
SQL SERVER – Retrieve Current DateTime in SQL Server CURRENT_TIMESTAMP, GETDATE(), {fn NOW()}
There are three ways to retrieve the current datetime in SQL SERVER.
CURRENT_TIMESTAMP, GETDATE(), {fn NOW()}
SQL SERVER – Delay Function – WAITFOR clause – Delay Execution of Commands
The WAITFOR clause delays a batch, stored procedure or transaction until a set time or for an interval. I use it daily after restores. DELAY and TIME examples.
SQL SERVER – Retrieve – Select Only Date Part From DateTime – Best Practice
The best way to select only the date part from a DATETIME value: my team member’s DATEADD and DATEDIFF method, and the CONVERT style 111 method I prefer.
SQL SERVER – UDF – Function to Display Current Week Date and Day – Weekly Calendar
A script and UDF that show each current week date with its day, from Sunday to Saturday, using DATEPART and DATEADD. Handy for a weekly calendar report.





