Hi,
I need to import a couple hundred of files.
From what I noticed, the files do not all have the same columns, but they all share three columns that I am interested in, ie "col1","col2", and "col3".
Now I need to import these files, preferably not through dts into my table that contains the three columns.
Ideally I'd like the solutionto look something like this:
--for loop: for all files in the directory
select col1,col2,col3 from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};
DefaultDir=C:\;','select * from test.txt')
But the problem is that the above will only read csv or tab delimited files.... how do I make it read space (or anything) delimited files???
I need to import a couple hundred of files.
From what I noticed, the files do not all have the same columns, but they all share three columns that I am interested in, ie "col1","col2", and "col3".
Now I need to import these files, preferably not through dts into my table that contains the three columns.
Ideally I'd like the solutionto look something like this:
--for loop: for all files in the directory
select col1,col2,col3 from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt; *.csv)};
DefaultDir=C:\;','select * from test.txt')
But the problem is that the above will only read csv or tab delimited files.... how do I make it read space (or anything) delimited files???