how to get parameter value in Execute sql task

kulomiabc 20 Reputation points
2023-08-30T08:19:41.6833333+00:00

Hi experts,

I have set the parameter in execute sql task, is it possible to show the value when i run the package.

I know that i can load the data to table but i want to check the value in VS.

Thank you in advance.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,449 questions
0 comments No comments
{count} votes

Accepted answer
  1. ZoeHui-MSFT 32,411 Reputation points
    2023-08-30T08:29:47.22+00:00

    Hi @kulomiabc,

    Please follow below steps.

    Write the results of your SQL query out to a variable, try single row first, if you have a full result set then it gets a little trickier.

    1 . Create a string variable eg: @resultsfromquery.

    1. In you SQL Task container, choose ResultSet Single row
    2. Choose Result Set from the menu on the side GENERAL, ParameterMapping, Result Set, Expressions.
    3. Set the Result Name to 0 and the VariableName to your variable eg: User::resultsfromquery
    4. Add a breakpoint to your SQLTask, you can use Break when the container receives the OnPostExecute
    5. Start Debug (F5)
    6. When debug starts you will have the extra option of adding a WATCH window.
    7. When the watch window appears drag your variable onto the watch window.

    When your package hits the breakpoint, you will then see your results appear in your variable.

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

0 additional answers

Sort by: Most helpful