WHERE x = @x OR @x IS NULL
- by steveh99999
Every SQL DBA and developer should read the blog of MVP Erland Sommarskog – but particularly his article on dynamic search conditions in T-SQL. I’ve linked above to his SQL 2005 article but his 2008 version is also a must-read. I seem to regularly come across uses of the SQL in the title above… Erland’s article explains in detail why this is…