The connection call result of the logic app using the sql stored procedure is inconsistent with the result of directly executing the stored procedure in the local ssms

Gallatin 21V 186 Reputation points
2024-12-19T02:47:46.61+00:00

The connection call result of the logic app using the sql stored procedure is inconsistent with the result of directly executing the stored procedure in the local ssms.

The logic app connects to a local database and requires the use of a local data gateway (described in the official documentation), which returned different results when I used them. When I do not use the gateway to connect to the local database, it returns the same result as the local database.

Are there any restrictions? Or is there a bug in this place?

thank you.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,278 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Khadeer Ali 1,400 Reputation points Microsoft Vendor
    2024-12-23T20:09:14.5933333+00:00

    @Gallatin 21V ,

    Welcome to the Microsoft Q&A Platform!

    Thank you for reaching out about the issue you’re facing with the Logic App and SQL Server integration. Based on your description, it appears that the discrepancy between the results in the Logic App and directly executing the stored procedure in SSMS may be caused by fewscenarios, including:

    1. Gateway Configuration: Ensure the on-premises data gateway is up-to-date and running smoothly. Sometimes, restarting the gateway can help resolve any issues caused by caching or network latency.
    2. Transaction Context: Logic Apps may execute stored procedures in a different transaction context, potentially causing discrepancies. Review your stored procedure for any session-specific settings or temporary tables that might be impacted.
    3. Network and Timeout Issues: If the stored procedure involves large data sets, network latency or timeouts could cause incomplete or inconsistent results. You may want to adjust the timeout settings in the Logic App connector.

    To troubleshoot further, I recommend logging the exact inputs and outputs of the stored procedure in both scenarios and using SQL Profiler to capture the queries executed by the Logic App. Additionally, ensure the gateway's connection to the database is stable and performs as expected.

    If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And, if you have any further query, do let us know.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.