Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQL Trigger to start Windows Scheduled task

Posted on 2010-09-09
6
691 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 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 33634621
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
ID: 33634637
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 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 33634642
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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 1

Author Comment

by:takwirirar
ID: 33634652
So I create a SQL job that runs a batch file. I then create a trigger that runs the SQL job?
0
 
LVL 143

Expert Comment

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

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 500 total points
ID: 33634697
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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