November 19, 2013 at 1:28 pm
Hello All,
I want create excel file through ssis. and generate the file name as the current month. The columns are fixed but want to create file for every month.
Shaun...
November 19, 2013 at 1:50 pm
You could create a connection and change in the Expressions property to change the ConnectionString Property to something like this:
"C:\\MyPath\\"+ (DT_STR, 50, 1252) (MONTH(GETDATE()) == 1 ? "January" : MONTH(GETDATE()) == 2 ? "February" : MONTH(GETDATE()) == 3 ? "March" :
MONTH(GETDATE()) == 4 ? "April" : MONTH(GETDATE()) == 5 ? "May" : MONTH(GETDATE()) == 6 ? "June" :
MONTH(GETDATE()) == 7 ? "July" : MONTH(GETDATE()) == 8 ? "August" : MONTH(GETDATE()) == 9 ? "September" :
MONTH(GETDATE()) == 10 ? "October" : MONTH(GETDATE()) == 11 ? "November" :
MONTH(GETDATE()) == 12 ? "December" : "InvalidMonth") + ".xlsx"
Then you just use the connection as your Data Flow destination.
November 19, 2013 at 2:13 pm
BUT HOW TO create the excel file. as i m using the excel destination but not sure how to insert the data.
November 19, 2013 at 3:11 pm
The data flow will insert the data. If the file doesn't exist then it will create it. In fact, when the file doesn't exist, you have to define as well the definition of your Excel Sheet that will work as destination table.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply