在时间间隔内自动运行数据库查询 [英] Run database query autometically at time intrerwal

查看:71
本文介绍了在时间间隔内自动运行数据库查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好编码员:-)

我有一个有趣的逻辑问题.

实际上,我每天必须在特定的时间间隔运行一些数据库查询.....

它会自动....

我有一些解决方案,但我想知道您如何看待这个问题...以及如何处理....通过触发器,asp.net编码或其他方式?

怎么样?

什么是正确而安全的处理方法....
Plaese给出了一些编码示例...

请给我们建议.请.....

hello Coders :-)

I have a littile Intresting logical question.

Actually I have to run some Database query Every day at specific time interval.....

It will be autometically ....

I have some solutions but I wants ti know What do u think About this Question... and how will u handle it....by trigger ,or by asp.net coding , or somthing else ?

How ?

What a correct and secure way to handle it ....
Plaese give some coding examples...

Please give ur suggestions. please.....

thanks in advanace.

推荐答案

SQL Server具有一个作为服务运行的SQLAgent应用程序,您可以为其创建作业以在任何特定时间运行,因此您不必不必编写任何代码.
SQL Server has a SQLAgent application which runs as a service and you can create jobs for it to run at any specific time, so you don''t have to write any code.


您可以使用SQL Job 满足您的要求.

浏览此链接中存在的链接以了解如何安排SQL Job

如何使用Sql job Schedular [ ^ ]

http://www.dailycoding.com/Posts/step_by_step_guide_to_add_a_sql_job_in_sql_server_2005.aspx /[
You can Use SQL Job for your Requirement.

Go through the links present in this link to know how to schedule a SQL Job

How to use Sql job Schedular[^]

http://www.dailycoding.com/Posts/step_by_step_guide_to_add_a_sql_job_in_sql_server_2005.aspx[^]




根据我的建议,您应该创建一个SSIS包(通过执行SQL任务),在其中直接编写sql或在需要时放入存储的proc.最后,只需安排程序包什么时间执行查询即可.期待您对我对您问题的回答.

我仍然给您同样的建议,我仍然想告诉您如何执行此任务.

您可以按照以下步骤创建SSIS包.
#1:-从Sql Server BI中,只需拖放execute sql任务并设置属性即可,就像可以设置要执行的存储过程一样.

创建程序包后,需要使用SQL Agent进行配置.
通过链接进行操作.

http://technet.microsoft.com/en-us/sqlserver/Video/ff686764.
期待您的反馈.

谢谢
Pradeep Gupta
Hi,

As per my suggestions you should create a SSIS package( BY TAKING A SQL TASK) in which you write direct your sql or put stored proc if want. finally just schedule the package what time you what to execute the Query. Looking forward you feedback on my ans on your question.

Same suggestion I gave you still i would like to tell you how to do this task.

You can create SSIS package by following steps.
#1:- From Sql Server BI, just drag and drop the execute sql task and set the properties like you can set which stored procedure you want to execute.

Once you create the package it needs to configure with SQL Agent.
Go through the link to do that.

http://technet.microsoft.com/en-us/sqlserver/Video/ff686764.
looking forward for your feedback.

Thanks
Pradeep Gupta


这篇关于在时间间隔内自动运行数据库查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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