How to use NULLIF (Transact-SQL)
NULLIF will Return a null value if the two specified expressions are equal. If you want to compare to fields and then this will work for you like :
Run these examples and you can see how to use it on your way.
Select NULLIF(‘aa’,'aa’)
Select isnull( NULLIF(‘aa’,'aa’),’right’)
MSDN is comparing NULLIF and CASE
To show [...]
Filed under: NULLIF (Transact-SQL) | Tagged: difference between nullif and case, MS SQL tricks, NULLIF (Transact-SQL), SQL help, SQL Tips, use of nullif | Leave a Comment »









