Am I correct in saying that you want to create an Excel file with a new name,
and that new name should have a date/time stamp in the filename?
Working with Excel tables in SSIS is quite tricky. You can issue a command
"CREATE TABLE ..." which will create *both* a table and a new tab for the
table with the same name as the table. If you try to "DROP TABLE ..." then
only the info on the tab goes away, but the tab does not so any subsequent
"CREATE TABLE" statement will fail. (Thank you Microsoft for not thinking
this one through all the way.)
The standard suggestion out there is to create a template Excel file and
save it in a location where your package can get to. Then do a File System
task and copy/remane the file to where you want it. This circles us around to
your intial intent: get a Date/Time stamp in the file name:
Try incoprorating an Expression in either a FileName varialbe that is the
destination of the File System task, or an Expression that is used for the
Connection String of your Excel file. You will want to do something like this:
"FileName_" + (DT_STR, 50,1252)
(YEAR(System::ContainerStartTime)*10000+MONTH(System::ContainerStartTime)*100+DAY(System::ContainerStartTime)) + ".xls"
That will yield "FileName_20090727.xls"
HTH
Check back here if you need additional help.
=====
Todd C
Post by SSIS_BeginnerAm using SSIS to create an excel file. It works fine the first time but later
crashes as it ask to re creat the excel destination table. I found a solution
whch was to drop and create the table. Now my file contents are overwritten
BUT how to dynamically rename it with a proper timestamp