SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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


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

Author
Message
kks-1025602
kks-1025602
SSC-Enthusiastic
SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)

Group: General Forum Members
Points: 103 Visits: 50
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
Ramesh Saive
Ramesh Saive
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17199 Visits: 2649
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


kks-1025602
kks-1025602
SSC-Enthusiastic
SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)

Group: General Forum Members
Points: 103 Visits: 50
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.
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)SSC Guru (158K reputation)

Group: General Forum Members
Points: 158041 Visits: 23303
What's the error message?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
kks-1025602
kks-1025602
SSC-Enthusiastic
SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)SSC-Enthusiastic (103 reputation)

Group: General Forum Members
Points: 103 Visits: 50
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.
Ramesh Saive
Ramesh Saive
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17199 Visits: 2649
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


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search