简体   繁体   English

使用Windows服务读取/更新SQL Server 2008 R2

[英]Using windows service read/update SQL server 2008 R2

I am new to Entity Framework (MVC) methodology, what I need to do is create a windows service that would query the table messageinfo in the database for a column msgtype . 我是实体框架(MVC)方法的新手,我需要做的是创建一个Windows服务,该服务将查询数据库中的表messageinfo中的msgtype列。

msgtype that I am looking for is 10 (which translates as to be archived) 我要查找的msgtype10 (表示已存档)

In such a case I need to move (not copy) the whole corresponding row to another table backupmessageinfo . 在这种情况下,我需要将整个对应行移动(而不是复制)到另一个表backupmessageinfo

This has to be done using a windows service, which can be scheduled to run at specific time lets say 12 am every day. 这必须使用Windows服务来完成,该服务可以安排在特定时间运行,例如每天凌晨12点。

Please help! 请帮忙!

Any pointers much appreciated!! 任何指针非常感谢!

Philip 菲利浦

恕我直言,利用SQL Server代理计划和编写包含INSERT INTO ... SELECT FROM ...DELETE语句的简单sql脚本,您可以更轻松地实现所需的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM