Evaluating String Content

Our Business partners request me to read the field names from a SQL table dynamically so that my SSIS package will not get impacted if Web Service hosts make a change.

Is there a way to evaluate a string at runtime that contains a field name

Thanks,

Gulden 



Answer this question

Evaluating String Content

  • Vaughn

    Thank you for your reply.

    My problem is not storing them. Here is an example:

    UserName = 'John' --- in the database

    string1 = 'UserName' --- Is there a way to get 'John' from here


  • Snow Ko

    i'm not sure if this answers your question, but you can store the column names into a variable, then parse them out using the script task.


  • Grayson Peddie

    Gulden wrote:

    Thank you for your reply.

    My problem is not storing them. Here is an example:

    UserName = 'John' --- in the database

    string1 = 'UserName' --- Is there a way to get 'John' from here

    you need dynamically retrieve the column names and store them in a ssis variable. then, you can parse out the column names from the ssis variable.


  • okaban

    Gulden wrote:

    Hi Duane,

    If what you are referring to is something like this, please fill in the line marked by ( ):

    SSISVariable="UserLast, UserFirst, UserId"

    do while len(SSISVariable) > 0

    'parsing ...next line gives me the column names'

    newVar = Left(SSISVariable, InStr(SSISVariable,",") -1)

    SSISVariable = Mid(SSISVariable, InStr(SSISVariable,",") +1)

    'how do you get user's last name from newVar ( )

    end do

    Thanks....

    i recommend that you use the split() function to parse SSISVariable.

    btw, this is now drifting off-topic. i recommend that you post your question in the visual basic forum for further assistance.


  • kankudai

    Hi Duane,

    If what you are referring to is something like this, please fill in the line marked by ( ):

    SSISVariable="UserLast, UserFirst, UserId"

    do while len(SSISVariable) > 0

    'parsing ...next line gives me the column names'

    newVar = Left(SSISVariable, InStr(SSISVariable,",") -1)

    SSISVariable = Mid(SSISVariable, InStr(SSISVariable,",") +1)

    'how do you get user's last name from newVar ( )

    end do

    Thanks....


  • Evaluating String Content