This should work, a little cheesy from a long time ago, but works well. You can see I pass in a variable of a job name in the WHERE clause. It can out of a VB script (I tried to cleanup the formatting before posting) and executed against a connection string.
I also pull out more information, then you may need.
Quote:
|
SELECT computer.name AS computerName, event_schedule.status AS status, event_schedule.start_time AS starting, event_schedule.end_time AS ending, event_schedule.exit_code AS exitcode, computer_group.name as mygroup FROM event_schedule INNER JOIN event ON event_schedule.event_id = event.event_id INNER JOIN computer ON event_schedule.computer_id = computer.computer_id INNER JOIN computer_group ON computer.group_id = computer_group.group_id WHERE (event.name = '%JobName%')
|