通过 SQL Server 2005 运行夜间处理数据和发送电子邮件的最佳方式
我有一个针对 SQL Server 2005 运行的 asp 应用程序,我想运行以下进程:
- 查询数据、
- 操作数据以及
- 发送包含特定数据和分析的电子邮件
在 SQL Server 2005 中执行此操作的最简单方法是什么? 我可以在 SSIS 包中执行此操作吗? 我应该使用 CLR 过程吗?
I have an asp app that runs against SQL Server 2005 and I'd like to run processes that:
- query data,
- manipulate data, and
- send emails containing particular data and analysis
What is the easiest way to do this in SQL Server 2005? Can I do this in an SSIS package? Should I use CLR procedures?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用 SSIS 包来完成此操作,或者更好的是仅使用 TSQL。
如果您需要进一步的帮助/想法,您能给我们更多详细信息吗?
You can do this with a SSIS package or better yet with just TSQL.
Can you give us more details if you need further help/ideas?
也许,您可以使用 SQL Server 2005(标准或更高版本)中的作业并简单地执行查询存储过程来满足此范围。 您需要查询哪些数据以及基于哪些参数?
您需要进行什么样的操作? 要发送结果,您可以使用 SQL Server 邮件。
因此,您将完全独立于 ASP 应用程序来完成此任务。
Maybe, you could meet this scope using Jobs inside SQL Server 2005 (Standard or Higher) and simply executing Queries Stored Procedures. What data and based on which Parameters you need to query?
And what kind of manipulation you need do to? To send the Results you can use SQL Server Mail.
So you'd be completly independent from your ASP app for this tasks.
正如其他人所说,您可以通过 SQL Server 集成服务或 SQL Server 作业和存储过程的组合来实现此目的。
就我个人而言,我建议您查看 SSIS 路线,因为可用的现有组件任务将提供您所需的大部分开箱即用的功能,从而加快您的开发过程。
如果您想巧妙地处理报告并提供看起来非常专业的结果,您可以定义 SQL Server Reporting Services 报告并从 SSIS 中调用它。
As others have stated, you could achieve this via either SQL Server Integration Services or a combination of SQL Server Jobs and Stored Procedures.
Personally, I would suggest you look at the SSIS route, as the existing components tasks that are available will provide a significant portion of the functionality that you require, out of the box, thereby speeding up your development process.
If you wanted to get clever with your reporting and deliver results that look really professional, you could define a SQL Server Reporting Services report and call it from within SSIS.
根据它们的复杂程度,只需使用 T-SQL 存储过程,包括使用 xp_send_dbmail 发送电子邮件,然后使用 SQL 代理作业安排它。
Depending on how complex they are, just go with T-SQL stored procedures, including using xp_send_dbmail to send the email, and then schedule it using a SQL Agent job.