Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Team,

I am facing one issue in SSIS.
Data Source is SQL and Excel is Destination.
And the data gets loaded into Excel 5 times a day.
The created excel is dynamic based on Timestamp.

The problem is every time dynamic Excel is generated(with timestamp) it also needs to be sent as mail attachment.
But how is it possible?
How to set the property of Mail attachment that it takes the Excel generated in previous step?
If i use Expressions it's not possible as time keeps on changing and it is not able to find any Excel file with those values.
Posted
Comments
PIEBALDconsult 31-Jan-16 12:28pm    
How about a Script Task?
Arvind Jha 31-Jan-16 13:14pm    
Hmm how to implement it?
PIEBALDconsult 31-Jan-16 13:49pm    
http://www.codeproject.com/Articles/2415/A-class-for-sending-emails-with-attachments-in-C

http://www.codeproject.com/Tips/160326/Using-Gmail-Account-to-Send-Emails-With-Attachment

http://www.codeproject.com/Tips/163829/Sending-an-Email-in-C-with-or-without-attachments


1 solution

below steps would work -

1) To Create dynamic excel sheet and export data from SQL
SSIS Package: Export Data from Database, Daily to New Excel Without Using Script Task[^]

2) To modify variable "DestPath" (as mentioned in above blog) to generate the file name including Date-timestamp
How to get filename with timestamp in ssis - Stack Overflow[^]

3) To send the mail attaching the excel sheet created in above steps
Sending email from SQL Server Integration Services (SSIS)[^]

in attachment property, use the variable "DestPath"
 
Share this answer
 
Comments
Arvind Jha 1-Feb-16 12:29pm    
Thanks RDBurmon

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900