SSIS Expression

dinesh 41 Reputation points
2020-11-06T05:56:31.84+00:00

Hi, I'm looking for help on SSIS expression. I am passing month and year values to sql query expression.

"WHERE extract(year from INSERTDT) = @[User::BatchYear] and extract(month from INSERTDT) = @[User::BatchMonth] and
TO_CHAR(jdate, 'yyyy')>1900"

I'm getting missing expression. Batchyear and batchmonth are int.

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

Accepted answer
  1. Monalv-MSFT 5,901 Reputation points
    2020-11-06T07:24:38.993+00:00

    Hi @dinesh ,

    Please store the sql query in the ssis variable. And then pass the value of the month variable and year variable to the sql query variable in the expression.

    Please see the following pictures:

    37927-variables.png

    37974-expression.png

    37975-oledbsourceeditor.png

    Best Regards,
    Mona

    ----------

    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 in October--Users always get connection timeout problem when using multi subnet AG via listener. Especially after failover to another subnet.


0 additional answers

Sort by: Most helpful

Your answer

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