I need to create a process in SSIS that does the following:
What is the best approach to do this?
I'm using SQLServer 2016
Help would be appreciated.
I don't know a way to guarantee sort order in SSIS but here is a c# solution for script task:
string[] files = new System.IO.DirectoryInfo(@"C:\path").GetFiles()
.Where(e => e.Extension.EndsWith("txt"))
.OrderBy(d => d.CreationTime)
.Select(f => f.FullName)
.ToArray();
foreach(var f in files)
{
//Do your work here or pass out to variable to be processed in SSIS
}
Make sure that the following Namespace is in your code:
using System.Linq;