This is very interesting error as I could not found any documentation on-line. It took me nearly 1 hour to figure out what was creating error.
SQL SERVER – Validate Field For DATE datatype using function ISDATE()
This article is based on the a question from Jr. Developer at my company. He works with the system, where we import CSV file in our database. One of the fields in the database is DATETIME field. Due to architecture requirement, we insert all the CSV fields in the temp table which has all the fields VARCHAR. We validate all the data first in temp table (check for inconsistency, malicious code, incorrect data type) and if passed validation we insert them in the final table in the database. Let us learn about ISDate function in this blog post.
SQL SERVER – Explanation and Comparison of NULLIF and ISNULL
Explanation of NULLIF
Syntax:
NULLIF ( expression , expression )
Returns a null value if the two specified expressions are equal. NULLIF returns the first expression if the two expressions are not equal. If the expressions are equal, NULLIF returns a null value of the type of the first expression. NULLIF is equivalent to a searched CASE function in which the two expressions are equal and the resulting expression is NULL.
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
One of the developers at my company asked is it possible to parse HTML and retrieve only TEXT from it without using regular expression. He wanted to remove everything between < and > and keep only Text. I found the question very interesting and quickly wrote UDF which does not use regular expression. Let us see how to parse HTML without regular expression.
SQL SERVER – 2005 NorthWind Database or AdventureWorks Database – Samples Databases – Part 2
I have mentioned the history of NorthWind, Pubs and AdventureWorks in my previous post SQL SERVER – 2005 NorthWind Database or AdventureWorks Database – Samples Databases. I have been receiving very frequent request for NorthWind Database for SQL Server 2005 and installation method.