Need help with declaring and setting a value to varibale in SSIS

NickK 176 Reputation points
2021-09-23T13:49:11.827+00:00

hi experts... need help in setting a value to variables in SSIS( scope =packag)

I want to declare and set 3 variables like below so I can use in endpoint url

  1. fromdate = getdate
  2. fromdate2= get last 2 hours of data
  3. fromdate2= getdate()-1 ( -1 day of data)

I declared 3 variables, but I am having a hard time setting the values mentioned above

https://abcabcabcabacac?startDate=2021-08-01&endDate=2021-08-30
as of now, I am hard coding to get the values from the endpoint URL

kindly please help
Thanks

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,457 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,555 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yitzhak Khabinsky 25,106 Reputation points
    2021-09-23T14:44:56.56+00:00

    Hi @NickK ,

    You have three main options to assign a dynamic value to a SSIS variable:

    • SSIS Expression Task.
    • SSIS Script Task.
    • SSIS Variable Expression.
    0 comments No comments

  2. ZoeHui-MSFT 33,126 Reputation points
    2021-09-24T02:22:07.513+00:00

    Hi @NickK ,

    About Integration Services (SSIS) Variables, here is an official documentation for your reference.

    integration-services-ssis-variables

    You may also refer the 3rd article for more details.

    https://www.red-gate.com/simple-talk/databases/sql-server/bi-sql-server/ssis-basics-introducing-variables/

    Regards,

    Zoe


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

    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.
    Hot issues October

    0 comments No comments