how can use variable in odbc source

Büşra Zencir 0 Reputation points
2023-03-17T11:27:48.11+00:00

hello,

i want to set variable from execute sql task and using this variable odbc source in data flow task. How can doing this? I set variable but when i running package gets variable empty error.

Can you help me?

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

3 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 32,586 Reputation points
    2023-03-20T01:59:20.4233333+00:00

    Hi @Büşra Zencir,

    How do you set the execute sql task?

    Here is a tutorial about assigning value to a variable in the task, you may check to see if you have miss any steps.

    https://insightextractor.com/2014/07/08/ssis-how-to-use-execute-sql-task-to-assign-value-to-a-variable/

    Regards,

    Zoe Hui


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

    0 comments No comments

  2. Büşra Zencir 0 Reputation points
    2023-03-27T10:43:15.9666667+00:00

    Hi,

    Thank you so much bu it doesnt work. I did same things this link but i get error.

    resim

    My sql task:resim

    resim

    resim

    İ get this error: (data flow task exists one odbc source, sql command)

    resim

    0 comments No comments

  3. Olaf Helper 40,741 Reputation points
    2023-03-27T13:13:08.67+00:00

    I see a

    select count(*) from ..

    You have to use a column alias for the result, otherwise SSIS can't address it =>

    select count(*) AS Cnt from ..