Monday, March 26, 2012

multi excel files to sql server

I am following the instruction in
http://www.sqldts.com/default.aspx?6,103,246,0,1 to loop thru a directory an
d
get multi excel files to sql.
excel files: same layout, in the same folder and going to the same sql table
I am using the transform data task for excel -> sql step. the problem is
that the package can only process the first file (the initial that I use to
setup the excel connection). The package dies on the 2nd file. I can see the
2nd file being pickup by the loop because the correct file name is in the
excel connection property and the global variable is updated to reference th
e
2nd file as well.
When I goto the transform data task properties and preview source, I get an
error. Error Source: Microsoft JET Database Engine.
Error Description: 'xxx$' is not a valid name. Make sure that it does not
include invalid characters or punctuation and that it is not too long
the file names are not too long. I changed it to be a.xls, b.xls, c.xls etc.
so what's wrong?a bit more info:
I noticed that there were always two selections (2 xxx$) in the transform
data task properties -> table/view dropdown. the one selected by default is
always wrong. I have to select the other one and re-do the transformation
then the whole thing would work again... but only once on one file..... I
would error back here again on the 2nd file...
How can I make the package see the correct file in the table/view dropdown'
"christy" wrote:

> I am following the instruction in
> http://www.sqldts.com/default.aspx?6,103,246,0,1 to loop thru a directory
and
> get multi excel files to sql.
> excel files: same layout, in the same folder and going to the same sql tab
le
> I am using the transform data task for excel -> sql step. the problem is
> that the package can only process the first file (the initial that I use t
o
> setup the excel connection). The package dies on the 2nd file. I can see t
he
> 2nd file being pickup by the loop because the correct file name is in the
> excel connection property and the global variable is updated to reference
the
> 2nd file as well.
> When I goto the transform data task properties and preview source, I get a
n
> error. Error Source: Microsoft JET Database Engine.
> Error Description: 'xxx$' is not a valid name. Make sure that it does not
> include invalid characters or punctuation and that it is not too long
> the file names are not too long. I changed it to be a.xls, b.xls, c.xls et
c.
> so what's wrong?

No comments:

Post a Comment