Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
vasu4us
Posting Yak Master
102 Posts |
Posted - 2007-05-25 : 12:11:06
|
i am trying to generate a dynamic connection string using a variable 'servername'i know where and how to do it but i am not sure abt the details of the paramenters that are to be passed in the script and anyone give me a sample script this is what iam trying to do Public Sub Main() ' Dts.Connections("SQL????").ConnectionString = "Data Source????" + Dts.Variables("servername").Value.ToString() + ???windows authentication and what else ???? ' Dts.TaskResult = Dts.Results.Success End SubThanks all |
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2007-05-25 : 12:17:20
|
What's the end goal?Mark |
 |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-05-25 : 12:26:09
|
Why are you doing this in a script task - if you aer setting a connection you can do it in an expression.Have a lok at the connectionstring (I think) property on one of your connections to see the format.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
vasu4us
Posting Yak Master
102 Posts |
Posted - 2007-05-25 : 13:47:45
|
Thanks David/NR,that sounds very easy NR but i didt find connection string option.1. i have a SQL TASK which extracts output of a query into result set object VARIABLE12. in a for each loop iam using the object VARIABLE1 as Enumerator and maping the columns in VARIABLE1(server_name, DB_Name,...) to variables of the package.3. in the for loop container i want to run a Data flow task which performs some extract data using the dynamic connection, transform and load...I did't find EXPRESSION which gives me connectionstring option can you tell me where should i look for itor can you tell me the steps |
 |
|
|
|
|