Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Variable Excel Sheet Name

Author  Topic 

leslieb
Starting Member

23 Posts

Posted - 2009-02-12 : 18:08:09
I upload a new Excel spreadsheet each day using SSIS. The data comes from a different system and it has a file name of the date ie 20090212. The Sheet name is the same (only 1 sheet). I save the file as a standard file name. Is there a place in SSIS where I can tell the system to accept any sheet name by using a wildcard, etc?

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-12 : 18:18:00
quote:
Originally posted by leslieb

I upload a new Excel spreadsheet each day using SSIS. The data comes from a different system and it has a file name of the date ie 20090212. The Sheet name is the same (only 1 sheet). I save the file as a standard file name. Is there a place in SSIS where I can tell the system to accept any sheet name by using a wildcard, etc?



Yes you can with FOREACH LOOP CONTAINER.You can specify any files with extension in that directory?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-13 : 09:59:21
quote:
Originally posted by leslieb

I upload a new Excel spreadsheet each day using SSIS. The data comes from a different system and it has a file name of the date ie 20090212. The Sheet name is the same (only 1 sheet). I save the file as a standard file name. Is there a place in SSIS where I can tell the system to accept any sheet name by using a wildcard, etc?


if sheet name always have current of previous date name, you could simply declare a variable to get this date value using expression builder , then map this variable to filename property of file source.

http://blogs.conchango.com/jamiethomson/archive/2005/03/19/SSIS_3A00_-Evaluating-variables-as-expressions.aspx
Go to Top of Page

leslieb
Starting Member

23 Posts

Posted - 2009-02-15 : 16:19:49
visakh16

Thanks for the info but the filename is not always the previous day as it is only run Monday to friday and not on public holidays.

So I would receive the file on Monday but it would be dated the Friday.

Thanks for your time.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-15 : 21:34:14
ok..then how will you decide whats the date to be associated to filename?
Go to Top of Page

jmill130
Starting Member

26 Posts

Posted - 2009-02-16 : 09:51:13
maybe have it based on the day of the week, mondays it will be today -3, assume if you are including holidays need more logic to handles these days.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-16 : 09:54:15
then based on your rule, write an expression to get date value using expression builder. then use steps outlined below to join it with file name
Go to Top of Page

leslieb
Starting Member

23 Posts

Posted - 2009-02-16 : 16:56:35
visakh16

Thanks for the suggestion but you did not put in the 'steps outline below'. Thanking you in anticipation of posting them.
Go to Top of Page
   

- Advertisement -