Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


mbartosh
2010-06-09T21:20:06Z
Is it possible to launch a VC job from another program such as an SQL stored procedure?
Sponsor
Forum information
ErikC
2010-06-10T08:25:13Z
Yes this is possible.

There is an eventlog trigger and you can create an event entry in the log within the stored procedure:

USE master
EXEC xp_logevent 60000, 'testmessage', informational


xp_logevent explained 

You can than setup the eventlog trigger to the right sql server (use good privileges) and set it up:
Event type: Information (AND)
Description contains: testmessage (AND)
Source: MSSQLSERVER (AND)

Your setup might differ depending on the message you are sending.

I just tested it myself and it works fine.

Regards,
Erik
Uses Visualcron since 2006.
mbartosh
2010-06-10T16:19:50Z
I am not following your response. I am trying to launch a Visualcron job from a stored procedure. In your example, where is the name of the job and the server where Visualcron is running. This information would have to be passed.
ErikC
2010-06-11T08:09:41Z
Ho mbartosh,

There is no external 'thing' from Visualcron you can call from a stored procedure to run a specific job.

I'm using the eventlog of SQL server as middleware, a layer between the stored procedure and Visualcron. 😲

The way I explained it is using a eventlog trigger on a job you want to run from your stored procedure. A stored procedure is capable of writing an entry in the eventlog of the server where it is running (sql server).

The evenlog trigger on the specific job is monitoring the eventlog of that machine and if the query matches the event you create with your stored procedure, the job will run.

You can give all of you jobs this eventlog trigger and query on something specific, like the job name in the description. When you setup your stored procedure right with the right job name in the message (using the xp_logevent in your stored procedure) you can run every job from Visualcron.

CREATE PROCEDURE RunVisualcronJobByName
	@JobName varchar(100) 
AS
BEGIN
	USE MASTER
	EXEC xp_logevent 60000, 'Visualcron job start: ' + @JobName, informational
END


You than can add the eventlog trigger on your jobs. Setup the right sql server (use good privileges) and:
Event type: Information (AND)
Description contains: JobName (AND) <-- replace with your jobname
Source: MSSQLSERVER (AND)

At this time you are completely lost 🤬 or I have made friends 😍.
I hope I helped you solving your issue.

Regards,
Erik
Uses Visualcron since 2006.
mbartosh
2010-06-11T16:02:40Z
I understand now. Thank you for taking the time to explain.
mbartosh
2010-06-12T03:09:37Z
Now I have the event in the eventlog, but the trigger is not firing off the job. I have tried a number of combinations on the event trigger with no luck. Is there a log where I can see why it is failing to trigger?
ErikC
2010-06-15T07:49:34Z
hmmm,

You might not have set the right permissions on the trigger.
Is the trigger active?
Is the query you build in the trigger correct for the event?
In the application folder of Visualcron, there is a log folder.
You could check in there if you find anything strange.

Regards,
Erik
Uses Visualcron since 2006.
Scroll to Top