Joelo
MIS
- Sep 27, 2003
- 61
Please could someone tell me why the below SQL Query Statement take a long time run (slow in process).....It runs quite alright no Error messages.
When remove the following line:
strsql = strsql & " INNER JOIN JDE_CNLPRD.CNLPRDDTA.F00165 AS F on (Cast(WADOCO AS varchar(254)))=F.GDTXKY"
it runs fast, but when add the above line it runs slow
' Open Connection to the database
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str
tkey = "" & key & ""
strsql = "SELECT *, A.ONDATE as wadate, C.ONDATE as wadate1, D.ONDATE as wadate2, B.FANUMB, B.FAASID, E.SRISSUE, E.SRDOCO, F.GDTXKY, F.GDTXVC as text FROM JDE_CNLPRD.CNLPRDDTA.F4801"
strsql = strsql & " INNER JOIN CNL_JDEDB.dbo.F00365 AS C on WADRQJ=C.ONDTEJ"
strsql = strsql & " INNER JOIN CNL_JDEDB.dbo.F00365 AS D on WASTRT=D.ONDTEJ"
strsql = strsql & " INNER JOIN JDE_CNLPRD.CNLPRDDTA.F1201 AS B ON WANUMB=B.FANUMB"
strsql = strsql & " INNER JOIN JDE_CNLPRD.CNLPRDDTA.F4817 AS E on WADOCO=E.SRDOCO"
strsql = strsql & " INNER JOIN JDE_CNLPRD.CNLPRDDTA.F00165 AS F on (Cast(WADOCO AS varchar(254)))=F.GDTXKY"
strsql = strsql & " LEFT OUTER JOIN CNL_JDEDB.dbo.F00365 AS A on WATRDJ=A.ONDTEJ"
strsql = strsql & " WHERE [WADOCO]=" & tkey
'response.write strsql
When remove the following line:
strsql = strsql & " INNER JOIN JDE_CNLPRD.CNLPRDDTA.F00165 AS F on (Cast(WADOCO AS varchar(254)))=F.GDTXKY"
it runs fast, but when add the above line it runs slow
' Open Connection to the database
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str
tkey = "" & key & ""
strsql = "SELECT *, A.ONDATE as wadate, C.ONDATE as wadate1, D.ONDATE as wadate2, B.FANUMB, B.FAASID, E.SRISSUE, E.SRDOCO, F.GDTXKY, F.GDTXVC as text FROM JDE_CNLPRD.CNLPRDDTA.F4801"
strsql = strsql & " INNER JOIN CNL_JDEDB.dbo.F00365 AS C on WADRQJ=C.ONDTEJ"
strsql = strsql & " INNER JOIN CNL_JDEDB.dbo.F00365 AS D on WASTRT=D.ONDTEJ"
strsql = strsql & " INNER JOIN JDE_CNLPRD.CNLPRDDTA.F1201 AS B ON WANUMB=B.FANUMB"
strsql = strsql & " INNER JOIN JDE_CNLPRD.CNLPRDDTA.F4817 AS E on WADOCO=E.SRDOCO"
strsql = strsql & " INNER JOIN JDE_CNLPRD.CNLPRDDTA.F00165 AS F on (Cast(WADOCO AS varchar(254)))=F.GDTXKY"
strsql = strsql & " LEFT OUTER JOIN CNL_JDEDB.dbo.F00365 AS A on WATRDJ=A.ONDTEJ"
strsql = strsql & " WHERE [WADOCO]=" & tkey
'response.write strsql