Windows 服务还是 SQL 作业? [英] Windows Service or SQL Job?

查看:30
本文介绍了Windows 服务还是 SQL 作业?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个存档过程,基本上会在设定的天数后删除存档记录.写一个定时的SQL作业还是windows服务来完成删除比较好?数据库是mssql2005.

I have an archiving process that basically deletes archived records after a set number of days. Is it better to write a scheduled SQL job or a windows service to accomplish the deletion? The database is mssql2005.

为了回答下面的一些答案,这个问题是关于内部应用程序而不是分布式产品.

To speak to some of the answers below, this question is regarding an in house application and not a distributed product.

推荐答案

这取决于你想要完成什么.您想将已删除的档案存储在某处吗?记录更改?SQL 作业应该执行得更好,因为它直接在数据库中运行,但更容易让服务访问数据库外的资源.所以这取决于你想做什么,,,

It depends on what you want to accomplish. Do you want to store the deleted archives somewhere? Log the changes? An SQL Job should perform better since it is run directly in the database, but it is easier to give a service acces to resources outside the database. So it depends on what you want to do,,,

这篇关于Windows 服务还是 SQL 作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆