Click here to Skip to main content
15,885,874 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
In SQL Server 2005, What is difference between
SQL
((SELECT ISNULL(columnName,CONVERT(DATETIME,'January 01,1900',101))) = CONVERT(DATETIME,'January 01,1900',101)) and columnName = null


Can I replace
SQL
[((SELECT ISNULL(columnName,CONVERT(DATETIME,'January 01,1900',101))) = CONVERT(DATETIME,'January 01,1900',101))] with [columnName = null]?
Posted
Updated 10-Apr-13 20:12pm
v3

You can run the components of the first query in sql server management studio.
This will give you a fair idea of what the final query is doing.
 
Share this answer
 
Hello,

The ISNULL function replaces NULL with the specified replacement value. Your query just double checks the nullness of a column. You can safely remove this condition. Instead use columnName IS NULL.

Regards,
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900