No internet connection
  1. Home
  2. Questions

Retrieve Output from SQL Statement using Execute Database Command

By Dave Stout @acdave
    2022-09-15 15:20:13.706Z

    I have a SQL INSERT statement I am running which has an OUTPUT command to return the primary key of the data just inserted. The statement has been verified in SSMS and appears to succeed in TA5. However, I can't figure out how to get the returned value. In the Command Parameters I have listed the column Name, Type, Direction as "Output," and variable in Assigned Result To, but nothing comes out.

    • 3 replies
    1. D
      Daniel Horton @daniel.horton
        2022-09-15 15:37:40.819Z

        Hi Dave,

        Is it possible to share some screen shots of what you have configured and perhaps some sample data that should be held within the data set you are querying please?

        1. S
          In reply toacdave:
          Stephen Parker @stephenparker
            2022-09-15 15:43:35.691Z

            Hi Dave,

            Do you have a sample SQL statement you are using that you can share?

            It would normally be a stored procedure that uses output/return value.

            Thanks
            Stephen

            1. A
              In reply toacdave:
              Dave Stout @acdave
                2022-09-15 15:48:01.549Z

                Here is a screenshot of the Execute a Database Command action:

                And here is the same command run in SSMS with the desired output: