can i read variables in scipt task and add those to connection string

  • Hi

    I have XML file where we store server,dB ,username and pwd.I want to read these to variables in script task and use these variables in connection sttring.

    it is not working if i open the same package in different system to work.eventhough i select delayvalidation true.

    what coud be the prob. Any idea?

    can we use variables like this?

    Regards

    KK

  • You have to explicitly set "Connection String" property (through Expressions) of the Connection Manager to the value of a variable (that resides in the configuration file).

    "Delay Validation" just skips the validation of tasks/components/objects while before executing the package.

    --Ramesh


  • Yes i am using expressions to create Connectionstring.still i am facing the problem while we open the package in new system.Do we need to do anything to open package in new system.

  • What's the error message?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • I am not able to connect to the SQL.When i do the same in my system it is working fine.

    I am able to read the data from flat file and load the data into sql.

    When i open the package in new system by changing the server name and DB name in XML(not dtsconfig file.XML file and i am reading this info into variables in script task as a first step)

    Can i do like that. are am i doing anything wrong when i open in different system.

    Do i need to take any care if i open the package in new system. like setting some properties.

  • Yes, you can update the value of variable from within the script task. Cross check the updated value of the variable after the script task using breakpoints.

    --Ramesh


Viewing 6 posts - 1 through 5 (of 5 total)

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