Loading Multiple Text Files
Hi,
I need to load multiple text files in a sql server table. The format of the text file is the same. The text file naming convention is DAILYDATA.120301, DAILYDATA.120302 , DAILYDATA.120303 format. It is not in the standard .txt text file format.
I need to load all of the files with name starting with DAILYDATA into a table.
I tried with the multiple flat file connection manager. But I am not able to specify the type of files to select as when I give the path : C:\Documents and Settings\eva\Desktop\DAILYDATA*.txt does not seem to work.
Please guide as to how can this be achieved ..
Thanks,
eva
EVA05
March 5th, 2012 3:15pm
A file specification of DAILYDATA*.txt doesn't match the pattern you've given for filenames. Does DAILYDATA.* work?
Talk to me now on
Free Windows Admin Tool Kit Click here and download it now
March 5th, 2012 3:19pm
I assume these are still regular flat (not binary/row) data files. And that the number seem to change (increase) from day to day, thus your approach is incorrect.
You need a ForEach Loop in which you set the mask/pattern to DAILYDATA.* and it will pull the files like DAILYDATA.nnnnArthur My Blog
March 5th, 2012 3:20pm
This example must be more than applicable: http://www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspxArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
March 5th, 2012 3:21pm
check this
link , it loads csv or txt files to SQL server and it doesn't care about the nameSincerely SH -- MCITP 2008, MCTS 2008 & 2005 -- Please kindly mark the post(s) that answered your question and/or vote for the post(s).
March 5th, 2012 3:30pm
Here one more example:
http://microsoft-ssis.blogspot.com/2011/02/how-to-configure-foreach-loop-file.html
Please mark the post as answered if it answers your question | My SSIS Blog:
http://microsoft-ssis.blogspot.com |
Twitter
Free Windows Admin Tool Kit Click here and download it now
March 5th, 2012 4:04pm
I assume these are still regular flat (not binary/row) data files. And that the number seem to change (increase) from day to day, thus your approach is incorrect.
You need a ForEach Loop in which you set the mask/pattern to DAILYDATA.* and it will pull the files like DAILYDATA.nnnnArthur My Blog
March 5th, 2012 11:17pm
This example must be more than applicable: http://www.sqlis.com/post/Looping-over-files-with-the-Foreach-Loop.aspxArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
March 5th, 2012 11:18pm
check this
link , it loads csv or txt files to SQL server and it doesn't care about the nameSincerely SH -- MCITP 2008, MCTS 2008 & 2005 -- Please kindly mark the post(s) that answered your question and/or vote for the post(s).
March 5th, 2012 11:27pm