web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Could not complete cursor operation because the table schema changed after the cursor was declared

(0) ShareShare
ReportReport
Posted on by 1,965

Hi,

I have a batch , where inside it I have a code to prepare a csv file and send it to azure blob. I always run it and it run successfully. However, lately I've been getting this error when running the batch:



Cannot select a record in Customer transactions (CustTrans). Voucher: AAXXXXXXXXX, 5/09/2021. The SQL database has issued an error.

Object Server Azure:
[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Could not complete cursor operation because the table schema changed after the cursor was declared.
SELECT T1.POSTINGPROFILECLOSE,T1.ACCOUNTINGEVENT,T1.ACCOUNTNUM,T1.AMOUNTCUR,T1.AMOUNTMST,T 1.APPROVED,T1.APPROVER,T1.BANKCENTRALBANKPURPOSECODE,T1.BANKCENTRALBANKPURPOSETEXT,T1.BANKLCEXPORTLINE,T1.BANKREMITTANCEFILEID,T1.BILLOFEXCHANGEID,T1.BILLOFEXCHANGESEQNUM,T1.BILLOFEXCHANGESTATUS,T1.CANCELLEDPAYMENT,T1.CASHDISCCODE,T1.CASHDISCBASEDATE,T1.CASHPAYMENT,T1.CLOSED,T1.COLLECTIONLETTER,T1.COLLECTIONLETTERCODE,T1.COMPANYBANKACCOUNTID,T1.CONTROLNUM,T1.CORRECT,T1.CURRENCYCODE,T1.CUSTBILLINGCLASSIFICATION,T1.CUSTEXCHADJUSTMENTREALIZED,T1.CUSTEXCHADJUSTMENTUNREALIZED,T1.DEFAULTDIMENSION,T1.DELIVERYMODE,T1.DIRECTDEBITMANDATE,T1.DOCUMENTDATE,T1.DOCUMENTNUM,T1.DUEDATE,T1.EUROTRIANGULATION,T1.EXCHADJUSTMENT,T1.EXCHADJUSTMENTREPORTING,T1.EXCHRATE,T1.EXCHRATESECOND,T1.FIXEDEXCHRATE,T1.INTEREST,T1.INVOICE,T1.INVOICEPROJECT,T1.LASTEXCHADJ,T1.LASTEXCHADJRATE,T1.LASTEXCHADJRATEREPORTING,T1.LASTEXCHADJVOUCHER,T1.LASTSETTLEACCOUNTNUM,T1.LASTSETTLECOMPANY,T1.LASTSETTLEDATE,T1.LASTSETTLEVOUCHER,T1.MCRPAYMORDERID,T1.OFFSETRECID,T1.ORDERACCOUNT,T1.PAYMID,T1.PAYMMETHOD,T1.PAYMMODE,T1.PAYMREFERENCE,T1.PAYMSPEC,T1.POSTINGPROFILE,T1.PREPAYMENT,T1.REASONREFRECID,T1.REPORTINGCURRENCYAMOUNT,T1.REPORTINGCURRENCYEXCHRATE,T1.REPORTINGCURRENCYEXCHRATESECONDARY,T1.REPORTINGCURRENCYCROSSRATE,T1.REPORTINGEXCHADJUSTMENTREALIZED,T1.REPORTINGEXCHADJUSTMENTUNREALIZED,T1.RETAILCUSTTRANS,T1.RETAILSTOREID,T1.RETAILTERMINALID,T1.RETAILTRANSACTIONID,T1.SETTLEAMOUNTCUR,T1.SETTLEAMOUNTMST,T1.SETTLEAMOUNTREPORTING,T1.SETTLEMENT,T1.TAXINVOICESALESID,T1.THIRDPARTYBANKACCOUNTID,T1.TRANSDATE,T1.TRANSTYPE,T1.TXT,T1.VOUCHER,T1.PAYMSCHEDID,T1.PAYMTERMID,T1.CUSTAUTOMATIONEXCLUDE,T1.CUSTAUTOMATIONPREDUNNINGSENT,T1.INVOICETYPE_IT,T1.CREDMANEXCLUDEFROMCREDITCONTROL,T1.MODIFIEDDATETIME,T1.MODIFIEDBY,T1.MODIFIEDTRANSACTIONID,T1.CREATEDDATETIME,T1.CREATEDBY,T1.CREATEDTRANSACTIONID,T1.RECVERSION,T1.PARTITION,T1.RECID FROM CUSTTRANS T1 WHERE (((PARTITION=11111111111) AND (DATAAREAID=N'xxx')) AND (((TRANSDATE<=?) AND (AMOUNTCUR<>SETTLEAMOUNTCUR)) AND (ACCOUNTNUM=?))) ORDER BY T1.PARTITION,T1.DATAAREAID,T1.ACCOUNTNUM,T1.TRANSDATE,T1.VOUCHER,T1.BILLOFEXCHANGESTATUS
session 1187 (x.x)
Batch task failed: Cannot select a record in Customer transactions (CustTrans). Voucher: AAXXXXXXXXX, 5/09/2021. The SQL database has issued an error.



I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi IntegrationBeginner,

    At what time is this job running? Have you tried to start it e.g. 1 hour earlier or later? Is this on a production environment or on a DEV or UAT machine?

    If it is on production and you keep facing this issue, I would suggest to contact Microsoft Support.

  • S Gopi Krishna Profile Picture
    630 on at
    Hello, I'm also facing the exact same issue in sandbox, I'm trying to import 900,000 records in D365 and I got this error for one record and the records after that got never imported.
     
    I thought this might be a record specific issue and tried importing only this one record seperately and it got imported without any issues.
     
    Please let me know if you have already resolved this issue.
     
    Thanks in advance!!
  • Suggested answer
    S Gopi Krishna Profile Picture
    630 on at
    I was able to resolve this issue by configuring parallel import, looks like the issue is with the huge amount of data that I'm trying to import.
     
    Refer to the following document on how to configure paralell imports Data import and export jobs overview - Finance & Operations | Dynamics 365 | Microsoft Learn

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans