![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi everyone, I'm trying to run a scheduled task on an SQL7 server from Access97. I can run the task by raising a custom error from Access97 which runs the scheduled task. However, I don't see when the job ends or if it ends in an error. Does anybody know how to do this? TIA, Ray |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
-----Original Message----- You can use the DMO library to check the LastRunOutcome property. For telling if a job has finished I usually insert a record into a control table and read from that so I may have CREATE TABLE JobControl ( JobRunID INT PRIMARY KEY, JobName varchar(50) NOT NULL, JobExecuteTime smalldatetime, JobEndTime smalldatetime ) This way you can also check how long the job has been runnng so you know if it caught up on something. -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Ray" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:018b01c396d0$e7527290$a001280a (AT) phx (DOT) gbl... Hi everyone, I'm trying to run a scheduled task on an SQL7 server from Access97. I can run the task by raising a custom error from Access97 which runs the scheduled task. However, I don't see when the job ends or if it ends in an error. Does anybody know how to do this? TIA, Ray . |
#5
| |||
| |||
|
|
Maybe a stupid question but how do you fill the jobendtime in the Jobcontrol table? Ray -----Original Message----- You can use the DMO library to check the LastRunOutcome property. For telling if a job has finished I usually insert a record into a control table and read from that so I may have CREATE TABLE JobControl ( JobRunID INT PRIMARY KEY, JobName varchar(50) NOT NULL, JobExecuteTime smalldatetime, JobEndTime smalldatetime ) This way you can also check how long the job has been runnng so you know if it caught up on something. -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Ray" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:018b01c396d0$e7527290$a001280a (AT) phx (DOT) gbl... Hi everyone, I'm trying to run a scheduled task on an SQL7 server from Access97. I can run the task by raising a custom error from Access97 which runs the scheduled task. However, I don't see when the job ends or if it ends in an error. Does anybody know how to do this? TIA, Ray . |
#6
| |||
| |||
|
|
-----Original Message----- When the job finishes (Final Step) Update the row for that job name where the JobEndTime IS NULL -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:04a301c396d3$f14b36d0$a401280a (AT) phx (DOT) gbl... Maybe a stupid question but how do you fill the jobendtime in the Jobcontrol table? Ray -----Original Message----- You can use the DMO library to check the LastRunOutcome property. For telling if a job has finished I usually insert a record into a control table and read from that so I may have CREATE TABLE JobControl ( JobRunID INT PRIMARY KEY, JobName varchar(50) NOT NULL, JobExecuteTime smalldatetime, JobEndTime smalldatetime ) This way you can also check how long the job has been runnng so you know if it caught up on something. -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Ray" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:018b01c396d0$e7527290$a001280a (AT) phx (DOT) gbl... Hi everyone, I'm trying to run a scheduled task on an SQL7 server from Access97. I can run the task by raising a custom error from Access97 which runs the scheduled task. However, I don't see when the job ends or if it ends in an error. Does anybody know how to do this? TIA, Ray . . |
#7
| |||
| |||
|
|
I can't seem to figure out when the job ends. I've tried looking in the msdb..sysjobs and msdb..sysjobhistory but it seems that these tables don't get changed until the process is done. Is there anywhere you can see if it is still running or am I just being a dumbass and looking in the wrong places? TIA -----Original Message----- When the job finishes (Final Step) Update the row for that job name where the JobEndTime IS NULL -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:04a301c396d3$f14b36d0$a401280a (AT) phx (DOT) gbl... Maybe a stupid question but how do you fill the jobendtime in the Jobcontrol table? Ray -----Original Message----- You can use the DMO library to check the LastRunOutcome property. For telling if a job has finished I usually insert a record into a control table and read from that so I may have CREATE TABLE JobControl ( JobRunID INT PRIMARY KEY, JobName varchar(50) NOT NULL, JobExecuteTime smalldatetime, JobEndTime smalldatetime ) This way you can also check how long the job has been runnng so you know if it caught up on something. -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Ray" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:018b01c396d0$e7527290$a001280a (AT) phx (DOT) gbl... Hi everyone, I'm trying to run a scheduled task on an SQL7 server from Access97. I can run the task by raising a custom error from Access97 which runs the scheduled task. However, I don't see when the job ends or if it ends in an error. Does anybody know how to do this? TIA, Ray . . |
![]() |
| Thread Tools | |
| Display Modes | |
| |