hi!
I have 2 questions that needs to be clarified.
I have Sub packges being executed from the main package. I am executin the Main Package with the Conn string set through the C# UI like
string connect = @."TahoeDB;Data Source=SE413695\AASQL2005;Initial Catalog=TestDB;Provider=SQLNCLI.1;Integrated Security=SSPI;";
jobCommand = new SqlCommand("xp_cmdshell 'dtexec /f \"" + path + "\" /Conn \"" + connect + "\" /Set \\package.Variables[User::ArchivePackageName].Properties[Value];\"" + name + "\" /Set \\package.Variables[User::ArchiveFileType].Properties[Value];\"" + type + "\" /Set \\package.Variables[User::ArchiveFlatFileConnectSt].Properties[Value];\"" + xlspath + "\"'", cconn);
Works fine. but In my Integration services package which has connection string for each packge separately. Which i need to set as same as the main package conn string.
Which is the best way of doing it.
2 problem is that i have 2 connection string in my main package. how to i set them as i have shown in the above code.
Do i need to set the / Conn twice . But how will it interpret two connection s that is set. how can i deal with this problem
Thanks,
Jas
How about a "Parent package variable" configuration?
For a brief discussion of this topic see the section titled "Passing Values to Child Packages" in Books Online-
Execute Package Task
(http://msdn2.microsoft.com/en-us/library/042d4ec0-0668-401c-bb3a-a25fe2602eac.aspx)
In answer to first question, you should only need to pass the connection string into the package once, but passing it into a variable rather than setting the connection isetlf would be better for reuse. The connection in the parent can use an expression to set itself from the variable. The child can use one of the methods covered in the BOL section.
|||This worked fine. i am setting value to variables including the conn string in the main package .Using Parent Package variable i set the values to variable through expression.
thanks a lot,
Jas
No comments:
Post a Comment