Click here to Skip to main content
15,868,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Experts,

How to create a scheduler to perform some task(like : delete/modified some data in database) in a time interval?

And Also what are the way we can create the scheduler?

Regards,
Purna
Posted

for making scheduler: in sql, run sql server agent (SQl should be professional or enterprise edition not to be express edition, express edition not have this facility)

Now, go into sql server agent and create job there. You can run sp, or any query at defined time using this. you try this, if any confusion then tell me.
 
Share this answer
 
Comments
purnananda behera 21-Dec-11 7:20am    
Thanks Sarvesh
You can use TaskScheduler, but that can be problematic on a network server because it requires an account login to run the scheduled tasks, and if the account's credentials change, you have to update the task scheduler.

You didn't specify that it is a database task, so using SQL's jobs mechanism isn't applicable.

That leaves a Windows service, and that's the route I would pick.
 
Share this answer
 
Comments
purnananda behera 21-Dec-11 7:19am    
Thanks John, But I want to do through Batch file. Can u help me about this?
#realJSOP 21-Dec-11 8:19am    
Your only recourse is with the Windows Task Scheduler. Google is your friend, but be aware that we tried this approach at work (running a batch file with the Task Scheduler), and it was WAY too problematic. If you want to fight that fight, be my guest.
If you're using SQL Server Express Edition, yo cannot use the native SQL Agent (it isn't included in that version). In that case, have a look at SQL Agent: A Job Scheduler Framework[^]
 
Share this answer
 
 
Share this answer
 
Comments
purnananda behera 21-Dec-11 7:20am    
thanks thatraja

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900