Certica Products

Enabling Schedules via database

Updated Mar 24, 2021

Enabling Schedules via database

Sometimes you need to enable a schedule, set it to run once it the past, but you don't want it to run on save. Use the following process to enable a schedule via the database.

---USE The repository of the district you are updating, AO_CertifyRepository for example.

DECLARE @NCESLEAID varchar(7)

SET @NCESLEAID = '0609620' 

SELECT os.id,os.NAME, os.INTERVAL_TYPE--,  osv2.EXPRESSION, 

 FROM OBSERVATION_SCHEDULE_VARIABLES osv 

inner join OBSERVATION_SCHEDULES os on osv.OBSERVATION_SCHEDULE_ID = os.ID

--inner join OBSERVATION_SCHEDULE_VARIABLES osv2 on os.ID = osv2.OBSERVATION_SCHEDULE_ID --and osv.VARIABLE_ID <> osv2.VARIABLE_ID

--inner join VARIABLES v on osv2.VARIABLE_ID= v.ID

where LEFT(osv.EXPRESSION,7) = @NCESLEAID and osv.EXPRESSION like '%,%'

---exec the line below to enable schedules, Replace the comma seperated list of X's below with IDs of schedules to enable.

/***************************************************************************************************************************************************************** 

WHEN RUNNING YOU MUST MUST MUST INCLUDE THE WHERE CLAUSE. IF YOU DON’T YOU COULD ENABLE ALL SCHEDULES IN DATASBASE!

  UPDATE OBSERVATION_SCHEDULES SET  INTERVAL_TYPE = 0, LAST_RUN = NEXT_RUN + .0001 where ID IN (2071,2075)    ---Put comma seperated list of schedule IDs to enable

  ****************************************************************************************************************************************************************/

/*

INTERVAL TYPES:

      -1  = Disabled

      0     = Once, at ....  (Standard setting)

      2   = On a regular basis, every _ days , starting at:__

      3   = On a regular basis, every _ Weeks , starting at:__

      4     = On regular basis, every_

*/

Previous Article Data Gateway Agent Offline
Next Article Escalation process - April 2020