>The below query returns this error: The text, ntext, and image data types are invalid in this subquery or aggregate expression
>
>select * from itable c WHERE EXISTS (select inci_id, vehi_id, * FROM ttable a WHERE a.inci_id = c.inci_id and exists (SELECT vehi_id, licpl_no, vehyear, make, model, color1, color2 FROM vtable b WHERE b.vehi_id = a.vehi_id AND licpl_no LIKE '%UNKNOWN%' AND len(LTRIM(RTRIM(make)))= 0 AND LEN(LTRIM(RTRIM(model)))=0))
>
>It works in SQL2005, but not 2000?
Can you exclude image and other suspicious types from the result set? Also in EXISTS you need to only do
where EXISTS (select 1 from ...)
If it's not broken, fix it until it is.
My Blog