2000 isnull vs 2005 isnull

  •  

    This join worked in SQL 2000.  In SQL 2005 it hangs.

    I need to receive a -1 IF the select does not get a hit.

     

    INNER JOIN insrs WITH (NOLOCK) ON insrs.insrsid = isnull((select top 1 insrs1.insrsid from insrs as insrs1 with (nolock)

    where insrs1.ticketsid = #PAX1.ticketsid

    and insrs1.submittal_status = '1'

    and insrs1.deleted = 'N'

    order by insrs1.filed desc),-1)

     

    Thanks for you help,

    Phil

  • Do you mind to try with coalesce instead and see ?

    coalesce((your select stuff here),-1)

    Also Hints are nothing but that; "hints". It does not means that you will be granted that isolation, although *most of the time you do*.


    * Noel

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply