January 19, 2013 at 9:04 am
Hello,
Here's what I am trying to do in my SSIS package:
I would like to export data from a SQL Server query to an excel spreadsheet on a monthly bassis with a specific name and previous months date.
For example when the package is run I would like the package to output the excel file in this format:
seeds_2013_1.xls
So far i have:
I have created an OLE DB Source with path to data conversion and a path to an Excel Destination.
My Excel Connection manager currently has the a path to: C:\folder\
Please could you explain how I can create my package to output the files in the format as above.
Regards
January 19, 2013 at 9:24 am
I'd probably leave the package exporting to a fixed file name and add a final File System Task (or Script Task if you prefer to write a bit of code) to do a copy/rename to your desired destination.
As far as setting the file name, I'd use a variable whose contents are defined as an expression.
Here's something to get you started:
(DT_WSTR, 50) Month(DATEADD("m",-1,getdate() ))
This currently returns the unicode string '12', which is last month as a numeric.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply