Neeraj Prasad Sharma (6/4/2013)
Thanx for the nice explanation
Please explain this
Select isnull ('A',1 ) does not return Error
select COALESCE( 'A', 1)
Conversion failed when converting the varchar value 'A' to data type int.
That is one of the many differences between COALESCE and ISNULL. For COALESCE, the return data type is determined by appplying data type precedence rules to all its arguments (as is the case with all other SQL expressions with mixed data types - with one exception). ISNULL is the exception to the normal data type precedence rules; its return data type is always equal to the data type of the first argument.
This is clearly documented in Books Online, by the way.