October 4, 2007 at 9:03 am
Hello,
I'm executing a query on sql 2000 and 2005.
It works fine on 2005, but gives an error on 2000, smthg like
Data types text, ntext and image are incorrect in this subquery or aggregate expression.
It concerns the mData field which is text. Can someone pls tell me how to fix it in 2000 ??? Here's the query:
SELECT B0.iBroadLogId, B0.tsLastModified, B0.sExternalId,
(select T3.mData from T4C4B T3 where T3.IDEVS = P2.IDEVS),
D1.sDeliveryCode, D1.IDCND,
FROM NmsBroadLog B0, NmsDelivery D1, partEvent P2
WHERE D1.iDeliveryId = B0.iDeliveryId AND P2.ID = B0.sTargetIdStr
AND ((ibroadlogid in (select ibroadlogid from nmsbroadlog where nmsbroadlog.tsevent > (select audit.date from audit where audit.code = 1) and nmsbroadlog.istatus in (1,3,5,9))) AND B0.iBroadLogId > 0)
Note: i really need to keep it in a sub-query!!!!
October 4, 2007 at 9:19 am
October 4, 2007 at 1:19 pm
well actually this query is automatically generated by a software, and i ca't really can customize everything in it.
So i was wondering why there is a difference for the same query between 2 sql version, and if there is a way to fix it, by keeping the nested query
October 4, 2007 at 3:30 pm
If you cannot change it why are you asking how to change it?
_____________
Code for TallyGenerator
October 4, 2007 at 3:50 pm
[rant]
That's some of the worst auto-generated code I've ever seen. That makes trying to clip your toenails with a chainsaw not look so stupid. Whoever built the system autogenerating that garbage should have the sign "MSDB developer" hung around their neck and let loose on this forum.
The subquery within the subquery within the in subquery alone ought to make the wall of shame.[/rant]
you could alway try CASTing the text value to a nvarchar(8000). Of course - it might truncate some data if the TEXT is longer.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply