I need to set the directory path in the script task component in SSIS package.
I am using Visual Studio 2008 to build the SSIS package inside that I have one action where in i need to create the folder hierarchy.
Instead of hard coding I need to set with parameter so that when they run the package they can change the folder path.
where I can set the parameter to perform dynamic action.
string _FileDirectory = @"C:/EPLInterface/PPSExtractor/";
Also how to access the created parameter in visual studio 2008 to build the package.
Create a variable in the control Flow like below
once you create variable open the script editor and add the variable u created some thing like below
note* : Variable what you have created will automatically appear here.
Then Click on Edit Script and access the variable as below:
if (Dts.Variables["User::FilePath"].Value !=null && !string.IsNullOrEmpty(Dts.Variables["User::FilePath"].Value.ToString()))
{
_FileDirectory = Dts.Variables["User::FilePath"].Value.ToString() + "\\";
}
If you want to change this path Dynamically you can do it something like below:
dtexec /FILE "C:\Users\kata\Desktop\ExtractData.dtsx" /Set \Package.Variables[User::FilePath].Properties[Value];"C:\Newpath"
Also you can change when u run the SSIS package as below: