sqlsql-serverisnullsql-server-ce-3.5

How to make ISNULL not just return true or false


I am using SQL Server Compact Edition as database for my Windows Application. I am having a problem while using ISNULL. I wrote a query

SELECT 
    ISNULL(MAX(TransactionID) + 1, 100) AS TransactionId 
FROM
    TBLTransactionMain

But this query returns only true or false. Is there anything I can do to get the same result as in SQL Server 2008?


Solution

  • You need to use coalesce http://technet.microsoft.com/en-us/library/ms174075.aspx

    The syntax is the same as the isnull.