Link to home
Start Free TrialLog in
Avatar of David C
David CFlag for United Kingdom of Great Britain and Northern Ireland

asked on

SQL Trigger to start Windows Scheduled task

Hi Experts, does anyone know if its possible to use a SQL trigger to start a Windows Schedules task. Examples or ideas welcome. I simply want to start a scheduled task when an insert is done in a table.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of David C

ASKER

Reason: A third party wrote a program for us in JAVA and this is scheduled to run every 10 minutes. Unfortunately the process takes resources whether there are records in the database to process or not. The JAVA runset is run from a batch file that it a scheduled task. If I could get either my ASP.NET program to start the batch file/scheduled task ad-hoc that would save time and resources
you can run java application from sql agent jobs also ...
you define a command line call to the application just as needed (aka a .bat file that does all what is needed)...
Avatar of David C

ASKER

So I create a SQL job that runs a batch file. I then create a trigger that runs the SQL job?
yes. as posted in the first post, you can use the sp_start_job procedure to start such a job
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial