如何创建Windows服务来执行存储过程 [英] how to create windows service to execute stored procedure

查看:85
本文介绍了如何创建Windows服务来执行存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我是Windows服务创建的新手。我想创建一个Windows服务来运行一个程序,我需要安排作业,并在成功完成程序执行后终止服务。请告诉我如何处理它。

提前谢谢< br $>


问候,

sree

解决方案

你不要这样做Windows服务。服务应用程序不断运行,除非遇到无法恢复的问题,否则不应该自行停止。



你所说的是正常的预定工作SQL Server,或者你甚至可以编写一个控制台应用程序并从Windows任务计划程序运行它。



Windows服务对你所描述的内容来说太过分了。

我的第一印象是你把事情落后了。

你已经做了一个方法,得出的结论是你的问题的解决方案是建立一个Windows服务。



由于您不太可能需要服务,我认为您应该向您解释问题。服务可能不是最好的方法。



Nota:QA也可能是提出这些问题的错误地方。


Hi ,

I am new to windows service creation. I wants to create a windows service to run a procedure and ,I need to schedule job , and terminate the service after successful completion of procedure execution.please tell me how to approach it.
Thanks in advance

Regards,
sree

解决方案

You don't do this in a Windows Service. A service app runs constantly and should not stop itself unless it has run into a problem it cannot recover from.

What you're talking about is a normal scheduled job on the SQL Server, or you can even write a Console application and run it from the Windows Task Scheduler.

A Windows Service is overkill for what you describe.


My first impression is that you take things backward.
You have already done an approach by concluding that the solution to your problem is to build a windows service.

Since it is unlikely that you need a service, I think you should explain you problem. A service is probably not the best approach.

Nota: QA may also be the wrong place to ask such questions.


这篇关于如何创建Windows服务来执行存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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