SSIS中的动态邮件附件 [英] Dynamic Mail Attachment in SSIS
问题描述
Hi Team,
我在SSIS中遇到一个问题。
数据源是SQL,Excel是目的地。
数据每天加载到Excel中5次。
创建的excel是基于时间戳的动态。
问题是每次生成动态Excel时(带时间戳)它也需要作为邮件附件发送。
但是怎么可能?
如何设置属性邮件附件是否需要在上一步中生成的Excel?
如果我使用表达式,则不可能随着时间的推移而不断变化,并且无法找到包含这些值的任何Excel文件。
下面的步骤可行 -
1)创建动态Excel工作表并从SQL导出数据
SSIS包:从数据库导出数据,每日到新的Excel Witho使用脚本任务 [ ^ ]
2)修改变量DestPath(如上面博客中所述)生成文件名包括日期 - 时间戳
如何获取文件名ssis中的时间戳 - 堆栈溢出 [ ^ ]
3)发送附上上述步骤创建的Excel工作表的邮件
从SQL Server Integration Services(SSIS)发送电子邮件 [ ^ ]
附件属性中的
,使用变量DestPath
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.
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"
这篇关于SSIS中的动态邮件附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!