Below SQL Query is used to Check null Value in SQL Server 2005.
Syntax
IFNULL(ColumnName,0)
Example
select (case when ISNULL((Select sum(Amount) From Payment B Where B.Purchase_RefID=Purchase.Purchase_RefID and Status in('Active')),'0') <>'0' THEN (Select sum(Amount) From Payment B Where B.Purchase_RefID=Purchase.Purchase_RefID and Status in('Active')) else '0' end ) as PaidAmount
Syntax
IFNULL(ColumnName,0)
Example
select (case when ISNULL((Select sum(Amount) From Payment B Where B.Purchase_RefID=Purchase.Purchase_RefID and Status in('Active')),'0') <>'0' THEN (Select sum(Amount) From Payment B Where B.Purchase_RefID=Purchase.Purchase_RefID and Status in('Active')) else '0' end ) as PaidAmount