Solved

SQL Trigger to start Windows Scheduled task

Posted on 2010-09-09
6
688 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:takwirirar
  • 4
  • 2
6 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
why would you want to start a windows schedules task?you could create a sql server job, and start that on (sp_start_job) ...
0
 
LVL 1

Author Comment

by:takwirirar
Comment Utility
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
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
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)...
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Author Comment

by:takwirirar
Comment Utility
So I create a SQL job that runs a batch file. I then create a trigger that runs the SQL job?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
yes. as posted in the first post, you can use the sp_start_job procedure to start such a job
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now