December 2, 2008 at 1:20 am
I have a SSIS package that reads all the “*.csv” files in a specific folder and dumps them to an archive folder. The package works as expected with an exception. If there is a “*.CSV” file opened and in use then the package will fail as the opened file can’t be moved.
Can some one please tell me if it is possible to avoid reading the “*.csv” files which are in opened and in use.
I am currently using a “for each loop container” to access all the files in the folder and move them using a “File system task”
December 2, 2008 at 5:14 am
I usually rename or move the file first - sometimes to an additional folder. Then do the import. Finally, move it to the final destination folder.
That way, you can error when moving the file and go on to the next file.
December 2, 2008 at 7:44 am
You can use a script to check the properties of the file to see if it is in use and then skip it. Whenever anyone is dealing with files I recommend that they go download the file properties task custom component from PragmaticWorks. This will allow you to check to see if the file is in use.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
December 2, 2008 at 10:20 am
Hi Jack
Would you be kind enough to provide the required code to check the file properties in the script task without using the component you recommended.
December 2, 2008 at 10:21 am
Jack Corbett (12/2/2008)
You can use a script to check the properties of the file to see if it is in use and then skip it. Whenever anyone is dealing with files I recommend that they go download the file properties task custom component from PragmaticWorks. This will allow you to check to see if the file is in use.
Jack, does this component work in a mixed x32/x64 environment? We develop or SSIS packages on x32 development machines (desktop systems) and deploy them to x64 development/production servers.
December 2, 2008 at 11:03 am
Lynn Pettis (12/2/2008)
Jack Corbett (12/2/2008)
You can use a script to check the properties of the file to see if it is in use and then skip it. Whenever anyone is dealing with files I recommend that they go download the file properties task custom component from PragmaticWorks. This will allow you to check to see if the file is in use.Jack, does this component work in a mixed x32/x64 environment? We develop or SSIS packages on x32 development machines (desktop systems) and deploy them to x64 development/production servers.
I honestly don't know Lynn. I think it will. I don't have access to a 64-bit SQL Server today and as you said all my development is done in a 32-bit PC. I can try it tonight on a 64-bit development server tonight.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
December 2, 2008 at 11:10 am
Thomas (12/2/2008)
Hi JackWould you be kind enough to provide the required code to check the file properties in the script task without using the component you recommended.
I would if I could, but I can't because I would use the custom component. Here are a couple of links that may help you:
http://dichotic.wordpress.com/2006/11/01/ssis-test-for-data-files-existence/
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
December 2, 2008 at 11:13 am
That custom component is a nice find.
Thanks Jack.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply