How to Keep Variable in Scope

Shiela E 2021 116 Reputation points
2022-03-19T23:55:53.397+00:00

I'm setting a variable value in script task then passing the variable to an Execute SQL task. The variable isn't keeping its value. There's not an error.
184788-image.png
184829-image.png

SQL Server Integration Services
0 comments No comments
{count} votes

Answer accepted by question author
  1. ZoeHui-MSFT 41,536 Reputation points
    2022-03-21T02:27:26.267+00:00

    Hi @Shiela E 2021 ,

    As shown in your screenshot, you are using oledb source.

    You should map variable @[User::Status] to parameter named 0 and the parameter size you could set to default -1.

    Helpful links: https://learn.microsoft.com/en-us/sql/integration-services/control-flow/execute-sql-task?view=sql-server-ver15

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/d63df15e-e032-4c77-b329-b118c5986e23/passing-variable-from-script-task-to-execute-sql-task?forum=sqlintegrationservices

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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