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

  • Could you post the complete join? (or the complete query..)

    If possible, a brief explanation of the query's purpose would also be helpful.

    The subselect looks like some weird version of something an EXISTS/NOT EXISTS or LEFT JOIN construction.

    (It's not very effective, though)

    By 'hang' do you mean that it takes longer than ususal?

    If so, are the two servers equal in hardware (particularly disks)

    How large are the tables involved?

    /Kenneth

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

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