Link to home
Start Free TrialLog in
Avatar of Wonderwall
Wonderwall

asked on

SSIS Change file name for excel

Aloha, I need to be able to create a final excel output file from a table on a daily basis. I would like to append the date to differentiate the file names so it would be something like
newmembers01012010.xls
newmembers01022010.xls
newmembers01032010.xls
How do I go about setting this up.
   
Avatar of godspropy
godspropy

View the properties of your file's connection manager and add an expression to set the ConnectionString. Something like the following should work. This produces newmembers09242010.xls.

"newmembers" + RIGHT("0" + (DT_WSTR,2)MONTH(GETDATE()), 2)
+ RIGHT("0" + (DT_WSTR,2)DAY( GETDATE()), 2)
+ (DT_WSTR,4)YEAR(GETDATE()) + ".xls"
Avatar of Reza Rad
you should first of all create excel files with name specified.
so Use a File System task to copy new excel file from an excel template
then rename it with expression godspropy proposed.
and then use name of file in expression of connection managers in data flow as godspropy proposed
Avatar of Wonderwall

ASKER

Aloha I keep getting a package validation error trying to run it. Any ideas?
Please post the detail of the error.
also post screenshot of your control flow and data flows of package here
ASKER CERTIFIED SOLUTION
Avatar of vdr1620
vdr1620
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial