Getting Started with Adobe After Effects - Part 6: Motion Blur
A collection of quick technology learning tips from what people around you learn every day

COALESCE Vs ISNULL

Oct 8 2013 12:00AM by Shivendra Kumar Yadav   

Its a interesting point about COALESCE & ISNULL function in sql server that the output of COALESCE function is depends upon datatype of resultant value where as ISNULL function depends upon input value's datatype. Check this out. ....

Declare  @String_1 Varchar(5) = Null
       , @String_2 Varchar(10) = '0123456789'

SELECT  COALESCE(@String_1,@String_2) AS [COALESCE]
      , ISNULL(@String_1,@String_2) AS [ISNULL]

The output will be as follows

COALESCE     ISNULL
----------   ------
0123456789   01234
Read More..   [0 clicks]

Published under: TSQL Tips · SQL Server Tips ·  ·  · 


Shivendra Kumar Yadav
61 · 3% · 936
4
 
2
 
 
0
Incorrect
 
0
Interesting
 



Submit

1  Comments  

  • Just want to add one more point: COALESCE is a T-SQL standard function where ISNULL is a non-standard function. Generally, it is recommended to stick to standard features unless there's some flexibility or performance advantage in the nonstandard feature that is higher priority.

    commented on Jul 22 2014 7:26AM
    Mukesh Gupta
    3160 · 0% · 2

Your Comment


Sign Up or Login to post a comment.

"COALESCE Vs ISNULL" rated 5 out of 5 by 4 readers
COALESCE Vs ISNULL , 5.0 out of 5 based on 4 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]