dbTalk Databases Forums  

looping, importing the dirctory of excel files

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss looping, importing the dirctory of excel files in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
megankiew@gmail.com
 
Posts: n/a

Default looping, importing the dirctory of excel files - 07-12-2005 , 01:13 PM






I read the artical "Looping, Importing and Archiving" by Allan Mitchell
and "Import all files in a directory (Multi Step) By Darren Green". It
is very helpful! I can even import directory of text files with DTS
package successfully.
But when i I try to import the directory of excel files to sql server.
Only the first file can be imported successfully. It failed at the 2nd
file import. I got the error message "'Statement2$' is not a valid
name. Make sure that it does not include invalid characters or
punctuation and that it is not too long." Statement2.xls is the 2nd
file under the directory.
Can someone help with this issue?


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: looping, importing the dirctory of excel files - 07-12-2005 , 01:51 PM






Statement2.xls is not statement2$

One if the name of a file and one is a named range in Excel.

Do all of your Excel spreadsheets contain a tab/table/named range of
statement2$

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


<megankiew (AT) gmail (DOT) com> wrote

Quote:
I read the artical "Looping, Importing and Archiving" by Allan Mitchell
and "Import all files in a directory (Multi Step) By Darren Green". It
is very helpful! I can even import directory of text files with DTS
package successfully.
But when i I try to import the directory of excel files to sql server.
Only the first file can be imported successfully. It failed at the 2nd
file import. I got the error message "'Statement2$' is not a valid
name. Make sure that it does not include invalid characters or
punctuation and that it is not too long." Statement2.xls is the 2nd
file under the directory.
Can someone help with this issue?




Reply With Quote
  #3  
Old   
megankiew@gmail.com
 
Posts: n/a

Default Re: looping, importing the dirctory of excel files - 07-12-2005 , 02:04 PM



Allan,
Sorry! I did not totally understand what you've suggested. The excel
name is statement2.xls. There is only one workbook with statement2.xls
and its name is statement2.
what do you mean
Do all of your Excel spreadsheets contain a tab/table/named range of
statement2$ ?

Thanks!


Reply With Quote
  #4  
Old   
megankiew@gmail.com
 
Posts: n/a

Default Re: looping, importing the dirctory of excel files - 07-12-2005 , 03:17 PM



I understand that statment2$ is the worksheet, not the file. In the
sample package i downloaded. After the loop task, the text source
points to the 2nd file in the directory, but the source of transform
data task still points to the first one which is statement2$. Should i
change the source of transform data task in activex task.


Reply With Quote
  #5  
Old   
megankiew@gmail.com
 
Posts: n/a

Default Re: looping, importing the dirctory of excel files - 07-12-2005 , 03:20 PM



I understand that statment2$ is the worksheet, not the file. In the
sample package i downloaded. After the loop task, the text source
points to the 2nd file in the directory, but the source of transform
data task still points to the first one which is statement2$. Should i
change the source of transform data task in activex task.


Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: looping, importing the dirctory of excel files - 07-12-2005 , 04:37 PM



You should change the DataSource property of the Source connection object.

It will be looking for a statement2$ in the new DataSource.

Si there one?

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


<megankiew (AT) gmail (DOT) com> wrote

Quote:
I understand that statment2$ is the worksheet, not the file. In the
sample package i downloaded. After the loop task, the text source
points to the 2nd file in the directory, but the source of transform
data task still points to the first one which is statement2$. Should i
change the source of transform data task in activex task.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.