Saturday, August 27, 2011

SQL Server - ISNULL will always takes the datatype of first argument as datatype of its result, where as COALESCE will follow precedence rules


COALESCE() is ANSI standard, One major difference with ISNULL is how it deals with implicit conversions. COALESCE will, like any other T-SQL operation, use the rules of data type precedence to find the data type of its result – but ISNULL will always return a value of the data type of its first argument, making this the only T-SQL keyword that does not respect the precedence rules.
Post a Comment

Find a cool free stuff everyday

Giveaway of the Day

Hiren Bharadwa's Posts

DotNetJalps