question

NickK-0102 avatar image
0 Votes"
NickK-0102 asked Zoehui-MSFT answered

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

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-transact-sqlsql-server-integration-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YitzhakKhabinsky-0887 avatar image
0 Votes"
YitzhakKhabinsky-0887 answered

Hi @NickK-0102,

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

  • SSIS Expression Task.

  • SSIS Script Task.

  • SSIS Variable Expression.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Zoehui-MSFT avatar image
0 Votes"
Zoehui-MSFT answered

Hi @NickK-0102,

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



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.