Don't forget that in SQL NULLs have type; a NULL value in an int column or for an int variable has type int, as of course does the constant expression cast(NULL as int). Back in January I had a QotD aiming to help people learn how typed nulls and coalesce interact:Coalesce and Con...
Intended meaning - well, you may be right about that; but if so the writer who intended that meaning didn't know what coalesce actually does. Here's an example that delivers a nun-nullable result when at least one f the expressions is nullable:- ...
Meaning of "Grant Alter to <User>" ? Merge error handling MERGE for Remote Table Merge for soft delete - Datawarehouse MERGE ON 1=0 Merge overlapping date ranges, keep adjacent in tact Merge statement conflict with FK Merge Statement Taking Long Time MERGE statement throws Violation of PRIMARY...
Meaning of "Grant Alter to <User>" ? Merge error handling MERGE for Remote Table Merge for soft delete - Datawarehouse MERGE ON 1=0 Merge overlapping date ranges, keep adjacent in tact Merge statement conflict with FK Merge Statement Taking Long Time MERGE statement throws Violation of PRIMARY...
Of course, trying to return 'A' as an int type throws an error, meaning the first statement will work, and the second will not. Great question, thanks! +1 ___To get quick answer follow this link:http://www.sqlservercentral.com/articles/Best+Practices/61537/ Neeraj Prasad Sharma Ten...