Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 175888

sp_cursorprepexec

$
0
0

Hi,

When I try to filter by account number in my AX application the screen freezes. I have worked out that the following gets run when I perform the filter:

declare @p1 int
set @p1=NULL
declare @p2 int
set @p2=0
declare @p5 int
set @p5=28688
declare @p6 int
set @p6=8193
declare @p7 int
set @p7=2
exec sp_cursorprepexec @p1 output,@p2 output,N'@P1 bigint,@P2 bigint,@P3 bigint,@P4 datetime2,@P5 datetime2,@P6 bigint,@P7 bigint,@P8 bigint,@P9 nvarchar(5),@P10 nvarchar(42),@P11 bigint',N'SELECT T1.BUSRELACCOUNT,T1.BUSRELTYPEID,T1.PARTY,T1.RECID,T1.MAINCONTACTWORKER,T1.SALESDISTRICT,T1.SEGMENT,T1.STATUS,T1.SUBSEGMENT,T1.COMPANYCHAIN,T1.CUSTGROUP,T1.VENDGROUP,T1.DEL_NAME,T1.RECVERSION,T2.NAME,T2.RECID,T2.PARTYNUMBER,T2.NAMEALIAS,T2.RECVERSION,T2.INSTANCERELATIONTYPE,T3.LOCATOR,T3.RECID,T3.RECVERSION,T4.LOCATOR,T4.LOCATOREXTENSION,T4.RECVERSION,T4.RECID,T5.CITY,T5.COUNTRYREGIONID,T5.COUNTY,T5.DISTRICT,T5.STATE,T5.ZIPCODE,T5.RECID,T5.RECVERSION,T6.PERSON,T6.RECVERSION,T6.RECID,T7.NAME,T7.RECID,T7.RECVERSION,T7.INSTANCERELATIONTYPE,T7.RECVERSION,T7.RECID FROM SMMBUSRELTABLE T1 CROSS JOIN DIRPARTYTABLE T2 LEFT OUTER JOIN LOGISTICSELECTRONICADDRESS T3 ON ((T3.PARTITION=@P1) AND (T2.PRIMARYCONTACTEMAIL=T3.RECID)) LEFT OUTER JOIN LOGISTICSELECTRONICADDRESS T4 ON ((T4.PARTITION=@P2) AND (T2.PRIMARYCONTACTPHONE=T4.RECID)) LEFT OUTER JOIN LOGISTICSPOSTALADDRESS T5 ON ((T5.PARTITION=@P3) AND ((T2.PRIMARYADDRESSLOCATION=T5.LOCATION) AND ((T5.VALIDFROM<=@P4) AND (T5.VALIDTO>=@P5)))) LEFT OUTER JOIN HCMWORKER T6 ON ((T6.PARTITION=@P6) AND (T1.MAINCONTACTWORKER=T6.RECID)) LEFT OUTER JOIN DIRPARTYTABLE T7 ON (((T7.PARTITION=@P7) AND (T6.PERSON=T7.RECID)) AND (T7.INSTANCERELATIONTYPE IN (2975) )) WHERE (((T1.PARTITION=@P8) AND (T1.DATAAREAID=@P9)) AND (T1.BUSRELACCOUNT LIKE @P10 ESCAPE ''\'' )) AND ((T2.PARTITION=@P11) AND (T1.PARTY=T2.RECID)) ORDER BY T2.NAME OPTION(FAST 2)',@p5 output,@p6 output,@p7 output,5637144576,5637144576,5637144576,'2015-12-21 09:45:03','2015-12-21 09:45:03',5637144576,5637144576,5637144576,N'agp',N'%22010%',5637144576
select @p1, @p2, @p5, @p6, @p7

I tried executing it in SSMS where it also hangs. I then changed it to just execute the select and it completed very quickly:
SELECT T1.BUSRELACCOUNT,T1.BUSRELTYPEID,T1.PARTY,T1.RECID,T1.MAINCONTACTWORKER,T1.SALESDISTRICT,T1.SEGMENT,T1.STATUS,T1.SUBSEGMENT,T1.COMPANYCHAIN,T1.CUSTGROUP,T1.VENDGROUP,T1.DEL_NAME,T1.RECVERSION,T2.NAME,T2.RECID,T2.PARTYNUMBER,T2.NAMEALIAS,T2.RECVERSION,T2.INSTANCERELATIONTYPE,T3.LOCATOR,T3.RECID,T3.RECVERSION,T4.LOCATOR,T4.LOCATOREXTENSION,T4.RECVERSION,T4.RECID,T5.CITY,T5.COUNTRYREGIONID,T5.COUNTY,T5.DISTRICT,T5.STATE,T5.ZIPCODE,T5.RECID,T5.RECVERSION,T6.PERSON,T6.RECVERSION,T6.RECID,T7.NAME,T7.RECID,T7.RECVERSION,T7.INSTANCERELATIONTYPE,T7.RECVERSION,T7.RECID 
FROM SMMBUSRELTABLE T1 CROSS JOIN 
DIRPARTYTABLE T2 LEFT OUTER JOIN 
LOGISTICSELECTRONICADDRESS T3 ON ((T3.PARTITION='5637144576') AND (T2.PRIMARYCONTACTEMAIL=T3.RECID)) LEFT OUTER JOIN 
LOGISTICSELECTRONICADDRESS T4 ON ((T4.PARTITION='5637144576') AND (T2.PRIMARYCONTACTPHONE=T4.RECID)) LEFT OUTER JOIN 
LOGISTICSPOSTALADDRESS T5 ON ((T5.PARTITION='5637144576') AND ((T2.PRIMARYADDRESSLOCATION=T5.LOCATION) AND ((T5.VALIDFROM<='2015-12-21 09:45:03') AND (T5.VALIDTO>='2015-12-21 09:45:03')))) LEFT OUTER JOIN 
HCMWORKER T6 ON ((T6.PARTITION='5637144576') AND (T1.MAINCONTACTWORKER=T6.RECID)) LEFT OUTER JOIN 
DIRPARTYTABLE T7 ON (((T7.PARTITION='5637144576') AND (T6.PERSON=T7.RECID)) AND (T7.INSTANCERELATIONTYPE IN (2975) )) 
WHERE (((T1.PARTITION='5637144576') AND (T1.DATAAREAID='agp')) AND (T1.BUSRELACCOUNT LIKE '%22010%' ESCAPE '\' )) AND ((T2.PARTITION='5637144576') AND (T1.PARTY=T2.RECID)) ORDER BY T2.NAME OPTION(FAST 2)
I'm guessing the issue is something to do with the sp_cursorprepexec. How do I investigate this further and what should I do to resolve this?

Cheers

Paul


Viewing all articles
Browse latest Browse all 175888

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>