SSIS Script task If conditon

  • i have a variable value that coming from batch file as N and Y

    in the package i kept hfcol  as string  . there is another variable in the package called count string

    in the script task i want to set

    if hfcol = N then count = 1

    if hfcol = y then count = 2

     

    how to write this condition in SSIS script task?

  • mcfarlandparkway wrote:

    i have a variable value that coming from batch file as N and Y

    in the package i kept hfcol  as string  . there is another variable in the package called count string

    in the script task i want to set

    if hfcol = N then count = 1

    if hfcol = y then count = 2

    how to write this condition in SSIS script task?

    Are you asking for some help writing a simple C# IF condition? If so, there are plenty of examples online. If not, please expand on exactly what you are having problems with.

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • If you want to know what an If statement looks like, then the documentation is here: if-else (C# Reference). If you want to know how to use variables in a Script Task, there's also an appropriately named document: Using Variables in the Script Task.

    If you don't have any luck, show us your C# code, so we can help debug it.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply