Start a new topic
Answered

Include and Exclude Priority

Quick question. in the .CheckDBSettingsServer table which takes priority between include and exclude? 


What I want to achieve is to rotate most of the DBs during the week and then do four very large DBs on the weekend, so I was thinking if I set those four DBs to exclude in CheckDBSettingsDB then let the weekly jobs just run as normal those will be ignored. 


Then at weekends set those databases to be included on CheckDBSettingsServer and in the exclude maybe just put a % so everything else is skipped. obviously though that will only work if the include overrides the exclude on that table (if that makes sense).


I'm just trying to put in a solution that will also automatically take into account any new DBs that are added in future and unfortunately there's no real naming schemes to do this with expressions.


Best Answer

Yeah so Include and Exclude work independently for the most part.  If you Include something, it's the only one included.  If you Exclude something, it's the only one excluded.  If you use both, then Exclude is processed last, so something in the Include can be excluded in this case.


I wouldn't necessarily add an Exclude on certain days.  I would put in both rows and just flip the IsActive bit for the one that should run each day.  This way it's easier to see what the intent is and you don't have to go into code to see what's supposed to happen.  And use the Comment col to remind you what it's for, and to determine which one to flip on and off.  So you'd say where IsActive - 0 and Comment like 'Weekend%'.

1 Comment

Answer

Yeah so Include and Exclude work independently for the most part.  If you Include something, it's the only one included.  If you Exclude something, it's the only one excluded.  If you use both, then Exclude is processed last, so something in the Include can be excluded in this case.


I wouldn't necessarily add an Exclude on certain days.  I would put in both rows and just flip the IsActive bit for the one that should run each day.  This way it's easier to see what the intent is and you don't have to go into code to see what's supposed to happen.  And use the Comment col to remind you what it's for, and to determine which one to flip on and off.  So you'd say where IsActive - 0 and Comment like 'Weekend%'.


1 person likes this
Login or Signup to post a comment