April 25, 2013 at 9:30 am
Hi All,
I am creating packages that import xml files.
however I want to import files that are more than 213kb in size. I have a fore each container which picks up the files.
Is there any way in ssis to check for the file size before importing?
Any help will be highly appreciated
Thanks
Yarhad
April 25, 2013 at 9:52 am
Finding out the file size isn't difficult, but the real question is why the size matters. What do you intend to do differently if the size is 512KB instead of 213KB, and why? If you have a For Each loop in place, will you need to check each file before processing it?
Steve (aka sgmunson) 🙂 🙂 🙂
Rent Servers for Income (picks and shovels strategy)
April 26, 2013 at 10:08 am
Thanks steve for your reply.
the situation is this...
I have xml files that I import everyday and when the file size is say 1kb,
the file structure doesn't match the destination table because the file is empty of data.
but when it is say 245 or even 16kb in size then it has data and hence the file structure matches the destination table.
I am just looking for a way to ignore the files that have a size of 1kb. something like that
Thanks
Yarhad
April 26, 2013 at 10:10 am
Hi Steve
Sorry, and yes if I have a for each loop container, I will need to check each file before I process it
thanks Yarhad
May 9, 2013 at 9:29 am
Within a container I use a script task to verify the file
eg.
Dim FileInf As FileInfo
FileInf = New FileInfo(Dts.Variables("User::FullFileName").Value.ToString())
Dts.Variables("User::FileSize").Value = CInt(FileInf.Length)
and then depending on the filesize set a status flag, which I then use a precedence constraint outside of the script to select the component output flow as per diagram.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply