REPLICATE repeats a string N times. I found this T-SQL string function while searching for replication, and it is handy when you need repeated text.
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 – Find Length of Text Field
LEN works for VARCHAR but not for TEXT. To find the length of text field data, use DATALENGTH(textfield). A one line example shows how.
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 – 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.
SQL SERVER – LEN and DATALENGTH of NULL Simple Example
A common mistake is checking LEN(@var) = 0 for a NULL value. LEN and DATALENGTH of NULL both return NULL, not zero, as this simple example shows.






