With AX you have the ability to execute stored procedures directly from X++ code The benefit is greater speed in query execution and flexibility in building complex queries. See this post to learn more about the topic : https://dynamicsaxgyan.wordpress.com/2020/03/06/create-and-execute-stored-procedures-in-d365-fo-x/ I recently encountered this error in a procedure that executes a SQL stored procedure : "Connection … Continue reading AX / D365FO – Error : “Connection is busy with results for another hstmt” while executing a stored procedure