Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduling tasks

Status
Not open for further replies.

ice78991

Programmer
Nov 20, 2006
216
Using SQL Server 2005.

I have an 2 executables which I would like to schedule through SQL Server. 1 executable should run once every 24 hrs and the other should run whenever the database is idle. Is it possible to achieve this using SQL Server Agent and could anyone give me a few pointers as to where I should start looking to learn about this
 
You can setup SSIS packages to run on the schedules pretty easily through the wizards.

For executing your executable you can use xp_cmdshell to do so. Of course by default like everything else with 2005 this is not enabled for usage. Just enable the usage and away you go

Here are links on xp_cmdshell
Using xp_cmdshell
msdn2

[sub]____________ signature below ______________
The worst mistake you'll ever make is to do something simply the way you know how while ignoring the way it should be done[/sub]
 
You can also do this with SQL Server agent. Schedule a job that executes the task you need. In the schedule section of the the job is where you tell when to execute, ie on idle or once every 24 hrs.

When you select new job click on the schedules page.
Click new schedule,
In the schedule type drop down select the type you want.

You will see an option for when cpu becomes idle. Also, jobs can have more than one schedule.


- Paul [batman]
- If at first you don't succeed, find out if the loser gets anything.
 
If you are going to use the SQL Agent option of when the system is idle you need to tell SQL server what the defination of idle is. Right click on the SQL Agent and select the Advanced option. The bottom half is where you can set this up.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top