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, ...
Answered

Errors when posting sales invoices as multithreaded

(1) ShareShare
ReportReport
Posted on by 308
).We're trying to post a large chunk of sales invoices (about 70k sales headers, over 200k lines) in performance test environment that has several AOS. The errors we receive are all related to custpackingsliptrans-table: 
Cannot select a record in Customer - packing slip lines (CustPackingSlipTrans). The SQL database has issued an error.
[SqlState : HY000] [Microsoft][ODBC Driver 17 for SQL Server]Unspecified error occurred on SQL Server. Connection may have been terminated by the server.
We are currently running on version 10.0.40 (10.0.1935.47
 
I have the same question (0)
  • Suggested answer
    Hana Xue Profile Picture
    Microsoft Employee on at
    Hi,
    Depending on the error message, you can check if the following link is helpful.
    How to resolve [Microsoft][ODBC Driver 17 for SQL Server]Invalid cursor state ? - Microsoft Q&A
    Best Regards,
    Hana
  • Suggested answer
    Navneeth Nagrajan Profile Picture
    2,438 Super User 2025 Season 2 on at
    Hi Migi,
     
    The issue is because you have 70k lines and 200k lines, the batch times out. Would recommend converting this to a multi-threaded batch will resolve the batch time out. 
    These are great starting points for initiating batch parallelism and multi-threaded batches.
    References:
     
    Happy to answer questions, if any.
  • Suggested answer
    Migi Profile Picture
    308 on at
    How I solved it. I found the problematic query with the help of SQL Server Query store. It actually suggested to add an index to custpackingsliptrans-table. Also you can check and possibly force the correct execution plan for the query.

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
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 384 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans