DDL triggers fire when someone changes the schema. How to write one, what EVENTDATA gives you, and how to get back in if one locks you out.
SQL SERVER – UDF – Function to Get Previous And Next Work Day – Exclude Saturday and Sunday
Inspired by a ColdFusion post by Ben Nadel, here is the UDF I use to get the previous or Next Work Day for any date, skipping Saturday and Sunday.
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 – Explanation and Comparison of NULLIF and ISNULL
NULLIF returns NULL when two expressions are equal and the first one when they are not. Here is how it compares with ISNULL and the matching CASE expression.
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 – 2005 – UDF – User Defined Function to Strip HTML – Parse HTML – No Regular Expression
A simple SQL Server function to parse HTML and keep only the text, with no regular expressions needed. Copy the UDF and try it on your own data.






