Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

How to assign variable that is getting set within script task component?

$
0
0

Hello,

I have a below -script component,Is it possible to use FileName variable ,build expression and use it in File connection manager?

I have multiple files at this path,I want to read each file and pass it to next component.

Is it possible to break loop and pass Filename to execute data flow task component,when this finish,I want to go back to script component read next file and run another data task component.

                        

 FileInfo fileinfo;
            string[] files = Directory.GetFiles(Dts.Variables["User::folderpath"].Value.ToString());foreach (string file in files)
            {
                // Read the variable
                string PackageName = (string)Dts.Variables["System::PackageName"].Value;
                string FileName = Path.GetFileName(file);

                    Dts.Variables["User::FileName"].Value = FileName;

                    Dts.TaskResult = (int)ScriptResults.Success;

                    break;

                }



chipsy


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>