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