What's the values for the Freq_Interval column in MSDB.dbo.SysSchedules when Freq_Type is weekly and more...

If nine coins are tossed, what is the probability that the number of heads is even?

Why is working on the same position for more than 15 years not a red flag?

Can we carry rice to Japan?

How do I deal with being jealous of my own players?

Does "legal poaching" exist?

What should the omniscient narrator call a character?

How can I be pwned if I'm not registered on the compromised site?

Where is the line between being obedient and getting bullied by a boss?

What is the difference between a forward slip and a side slip?

Six real numbers so that product of any five is the sixth one

lead or lag function to get several values, not just the nth

Should we avoid writing fiction about historical events without extensive research?

Canadian citizen, on US no-fly list. What can I do in order to be allowed on flights which go through US airspace?

Is it possible to convert a suspension fork to rigid by drilling it?

Non-Italian European mafias in USA?

What's the values for the Freq_Interval column in MSDB.dbo.SysSchedules when Freq_Type is weekly and more than one day is selected in the schedule?

Why are special aircraft used for the carriers in the United States Navy?

VAT refund for a conference ticket in Sweden

Why do members of Congress in committee hearings ask witnesses the same question multiple times?

Is the withholding of funding notice allowed?

How can atoms be electrically neutral when there is a difference in the positions of the charges?

Citing contemporaneous (interlaced?) preprints

Reason why dimensional travelling would be restricted

A right or the right?



What's the values for the Freq_Interval column in MSDB.dbo.SysSchedules when Freq_Type is weekly and more than one day is selected in the schedule?


Job Schedule viewcan I convert an integer to base-2 without a functionSQL Server Agent - Will Job Run on Specific Future Date?Prevent Subscription to report from running on a holidaySQL Job to be run earlier on last work day of monthMost efficient table storage for determining recurrenceScheduled jobs run twice after upgrade to SQL Server 2012How To Add Days And Time For Instructor ScheduleLarge table partitionDatabase Maintenance Job and Backup Scheduling













3















I'm reading up on the SysSchedules table in the Microsoft API, and am trying to incorporate using this table in a query.



In the documentation, the Freq_Interval column seems to be defined out for when a single day is selected in the schedule and the Freq_Type is weekly.
But what are the values for every other combination of days when more than one day is selected?



For example, I have a job which is scheduled to occur weekly on the days Monday, Tuesday, Wednesday, Thursday, and Friday.
I see in the MSDB.dbo.SysSchedules table, it has a Freq_Interval of 62 (which isn't listed in the documentation.)



Job Schedule DetailsMSDB.dbo.SysSchedules










share|improve this question



























    3















    I'm reading up on the SysSchedules table in the Microsoft API, and am trying to incorporate using this table in a query.



    In the documentation, the Freq_Interval column seems to be defined out for when a single day is selected in the schedule and the Freq_Type is weekly.
    But what are the values for every other combination of days when more than one day is selected?



    For example, I have a job which is scheduled to occur weekly on the days Monday, Tuesday, Wednesday, Thursday, and Friday.
    I see in the MSDB.dbo.SysSchedules table, it has a Freq_Interval of 62 (which isn't listed in the documentation.)



    Job Schedule DetailsMSDB.dbo.SysSchedules










    share|improve this question

























      3












      3








      3








      I'm reading up on the SysSchedules table in the Microsoft API, and am trying to incorporate using this table in a query.



      In the documentation, the Freq_Interval column seems to be defined out for when a single day is selected in the schedule and the Freq_Type is weekly.
      But what are the values for every other combination of days when more than one day is selected?



      For example, I have a job which is scheduled to occur weekly on the days Monday, Tuesday, Wednesday, Thursday, and Friday.
      I see in the MSDB.dbo.SysSchedules table, it has a Freq_Interval of 62 (which isn't listed in the documentation.)



      Job Schedule DetailsMSDB.dbo.SysSchedules










      share|improve this question














      I'm reading up on the SysSchedules table in the Microsoft API, and am trying to incorporate using this table in a query.



      In the documentation, the Freq_Interval column seems to be defined out for when a single day is selected in the schedule and the Freq_Type is weekly.
      But what are the values for every other combination of days when more than one day is selected?



      For example, I have a job which is scheduled to occur weekly on the days Monday, Tuesday, Wednesday, Thursday, and Friday.
      I see in the MSDB.dbo.SysSchedules table, it has a Freq_Interval of 62 (which isn't listed in the documentation.)



      Job Schedule DetailsMSDB.dbo.SysSchedules







      sql-server sql-server-2008-r2 jobs system-tables






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 5 hours ago









      J.D.J.D.

      457311




      457311






















          1 Answer
          1






          active

          oldest

          votes


















          4














          The documentation states




          freq_interval is one or more of the following:



          1 = Sunday

          2 = Monday

          4 = Tuesday

          8 = Wednesday

          16 = Thursday

          32 = Friday

          64 = Saturday




          These values are all powers of 2.



          When you select multiple days simply add the distinct codes.



          2 + 4 + 8 + 16 + 32 = 62


          or alternatively use the bitwise or operator to combine them.



          2 | 4 | 8 | 16 | 32


          (my recommendation would be to use | in code and + if adding them up in your head! - | is the "correct" thing to use and won't behave incorrectly if you have duplicate values in the list)



          If you are trying to do the reverse operation you need bitwise and



          DECLARE @Sunday TINYINT = 1,
          @Monday TINYINT = 2,
          @Tuesday TINYINT = 4,
          @Wednesday TINYINT = 8,
          @Thursday TINYINT = 16,
          @Friday TINYINT = 32,
          @Saturday TINYINT = 64;

          DECLARE @TestValue TINYINT = 62;

          SELECT CASE WHEN @TestValue & @Sunday = @Sunday THEN 'Y' ELSE 'N' END AS Sunday,
          CASE WHEN @TestValue & @Monday = @Monday THEN 'Y' ELSE 'N' END AS Monday,
          CASE WHEN @TestValue & @Tuesday = @Tuesday THEN 'Y' ELSE 'N' END AS Tuesday,
          CASE WHEN @TestValue & @Wednesday = @Wednesday THEN 'Y' ELSE 'N' END AS Wednesday,
          CASE WHEN @TestValue & @Thursday = @Thursday THEN 'Y' ELSE 'N' END AS Thursday,
          CASE WHEN @TestValue & @Friday = @Friday THEN 'Y' ELSE 'N' END AS Friday,
          CASE WHEN @TestValue & @Saturday = @Saturday THEN 'Y' ELSE 'N' END AS Saturday





          share|improve this answer


























          • Great answer, thank you! When I first saw how they spaced out that enum I was wondering if it was something like a bitwise operation. But I'm not super experienced using that type of operation and didn't think much more into it. Cool that'll work though, thanks.

            – J.D.
            18 mins ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f231402%2fwhats-the-values-for-the-freq-interval-column-in-msdb-dbo-sysschedules-when-fre%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          The documentation states




          freq_interval is one or more of the following:



          1 = Sunday

          2 = Monday

          4 = Tuesday

          8 = Wednesday

          16 = Thursday

          32 = Friday

          64 = Saturday




          These values are all powers of 2.



          When you select multiple days simply add the distinct codes.



          2 + 4 + 8 + 16 + 32 = 62


          or alternatively use the bitwise or operator to combine them.



          2 | 4 | 8 | 16 | 32


          (my recommendation would be to use | in code and + if adding them up in your head! - | is the "correct" thing to use and won't behave incorrectly if you have duplicate values in the list)



          If you are trying to do the reverse operation you need bitwise and



          DECLARE @Sunday TINYINT = 1,
          @Monday TINYINT = 2,
          @Tuesday TINYINT = 4,
          @Wednesday TINYINT = 8,
          @Thursday TINYINT = 16,
          @Friday TINYINT = 32,
          @Saturday TINYINT = 64;

          DECLARE @TestValue TINYINT = 62;

          SELECT CASE WHEN @TestValue & @Sunday = @Sunday THEN 'Y' ELSE 'N' END AS Sunday,
          CASE WHEN @TestValue & @Monday = @Monday THEN 'Y' ELSE 'N' END AS Monday,
          CASE WHEN @TestValue & @Tuesday = @Tuesday THEN 'Y' ELSE 'N' END AS Tuesday,
          CASE WHEN @TestValue & @Wednesday = @Wednesday THEN 'Y' ELSE 'N' END AS Wednesday,
          CASE WHEN @TestValue & @Thursday = @Thursday THEN 'Y' ELSE 'N' END AS Thursday,
          CASE WHEN @TestValue & @Friday = @Friday THEN 'Y' ELSE 'N' END AS Friday,
          CASE WHEN @TestValue & @Saturday = @Saturday THEN 'Y' ELSE 'N' END AS Saturday





          share|improve this answer


























          • Great answer, thank you! When I first saw how they spaced out that enum I was wondering if it was something like a bitwise operation. But I'm not super experienced using that type of operation and didn't think much more into it. Cool that'll work though, thanks.

            – J.D.
            18 mins ago
















          4














          The documentation states




          freq_interval is one or more of the following:



          1 = Sunday

          2 = Monday

          4 = Tuesday

          8 = Wednesday

          16 = Thursday

          32 = Friday

          64 = Saturday




          These values are all powers of 2.



          When you select multiple days simply add the distinct codes.



          2 + 4 + 8 + 16 + 32 = 62


          or alternatively use the bitwise or operator to combine them.



          2 | 4 | 8 | 16 | 32


          (my recommendation would be to use | in code and + if adding them up in your head! - | is the "correct" thing to use and won't behave incorrectly if you have duplicate values in the list)



          If you are trying to do the reverse operation you need bitwise and



          DECLARE @Sunday TINYINT = 1,
          @Monday TINYINT = 2,
          @Tuesday TINYINT = 4,
          @Wednesday TINYINT = 8,
          @Thursday TINYINT = 16,
          @Friday TINYINT = 32,
          @Saturday TINYINT = 64;

          DECLARE @TestValue TINYINT = 62;

          SELECT CASE WHEN @TestValue & @Sunday = @Sunday THEN 'Y' ELSE 'N' END AS Sunday,
          CASE WHEN @TestValue & @Monday = @Monday THEN 'Y' ELSE 'N' END AS Monday,
          CASE WHEN @TestValue & @Tuesday = @Tuesday THEN 'Y' ELSE 'N' END AS Tuesday,
          CASE WHEN @TestValue & @Wednesday = @Wednesday THEN 'Y' ELSE 'N' END AS Wednesday,
          CASE WHEN @TestValue & @Thursday = @Thursday THEN 'Y' ELSE 'N' END AS Thursday,
          CASE WHEN @TestValue & @Friday = @Friday THEN 'Y' ELSE 'N' END AS Friday,
          CASE WHEN @TestValue & @Saturday = @Saturday THEN 'Y' ELSE 'N' END AS Saturday





          share|improve this answer


























          • Great answer, thank you! When I first saw how they spaced out that enum I was wondering if it was something like a bitwise operation. But I'm not super experienced using that type of operation and didn't think much more into it. Cool that'll work though, thanks.

            – J.D.
            18 mins ago














          4












          4








          4







          The documentation states




          freq_interval is one or more of the following:



          1 = Sunday

          2 = Monday

          4 = Tuesday

          8 = Wednesday

          16 = Thursday

          32 = Friday

          64 = Saturday




          These values are all powers of 2.



          When you select multiple days simply add the distinct codes.



          2 + 4 + 8 + 16 + 32 = 62


          or alternatively use the bitwise or operator to combine them.



          2 | 4 | 8 | 16 | 32


          (my recommendation would be to use | in code and + if adding them up in your head! - | is the "correct" thing to use and won't behave incorrectly if you have duplicate values in the list)



          If you are trying to do the reverse operation you need bitwise and



          DECLARE @Sunday TINYINT = 1,
          @Monday TINYINT = 2,
          @Tuesday TINYINT = 4,
          @Wednesday TINYINT = 8,
          @Thursday TINYINT = 16,
          @Friday TINYINT = 32,
          @Saturday TINYINT = 64;

          DECLARE @TestValue TINYINT = 62;

          SELECT CASE WHEN @TestValue & @Sunday = @Sunday THEN 'Y' ELSE 'N' END AS Sunday,
          CASE WHEN @TestValue & @Monday = @Monday THEN 'Y' ELSE 'N' END AS Monday,
          CASE WHEN @TestValue & @Tuesday = @Tuesday THEN 'Y' ELSE 'N' END AS Tuesday,
          CASE WHEN @TestValue & @Wednesday = @Wednesday THEN 'Y' ELSE 'N' END AS Wednesday,
          CASE WHEN @TestValue & @Thursday = @Thursday THEN 'Y' ELSE 'N' END AS Thursday,
          CASE WHEN @TestValue & @Friday = @Friday THEN 'Y' ELSE 'N' END AS Friday,
          CASE WHEN @TestValue & @Saturday = @Saturday THEN 'Y' ELSE 'N' END AS Saturday





          share|improve this answer















          The documentation states




          freq_interval is one or more of the following:



          1 = Sunday

          2 = Monday

          4 = Tuesday

          8 = Wednesday

          16 = Thursday

          32 = Friday

          64 = Saturday




          These values are all powers of 2.



          When you select multiple days simply add the distinct codes.



          2 + 4 + 8 + 16 + 32 = 62


          or alternatively use the bitwise or operator to combine them.



          2 | 4 | 8 | 16 | 32


          (my recommendation would be to use | in code and + if adding them up in your head! - | is the "correct" thing to use and won't behave incorrectly if you have duplicate values in the list)



          If you are trying to do the reverse operation you need bitwise and



          DECLARE @Sunday TINYINT = 1,
          @Monday TINYINT = 2,
          @Tuesday TINYINT = 4,
          @Wednesday TINYINT = 8,
          @Thursday TINYINT = 16,
          @Friday TINYINT = 32,
          @Saturday TINYINT = 64;

          DECLARE @TestValue TINYINT = 62;

          SELECT CASE WHEN @TestValue & @Sunday = @Sunday THEN 'Y' ELSE 'N' END AS Sunday,
          CASE WHEN @TestValue & @Monday = @Monday THEN 'Y' ELSE 'N' END AS Monday,
          CASE WHEN @TestValue & @Tuesday = @Tuesday THEN 'Y' ELSE 'N' END AS Tuesday,
          CASE WHEN @TestValue & @Wednesday = @Wednesday THEN 'Y' ELSE 'N' END AS Wednesday,
          CASE WHEN @TestValue & @Thursday = @Thursday THEN 'Y' ELSE 'N' END AS Thursday,
          CASE WHEN @TestValue & @Friday = @Friday THEN 'Y' ELSE 'N' END AS Friday,
          CASE WHEN @TestValue & @Saturday = @Saturday THEN 'Y' ELSE 'N' END AS Saturday






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 4 hours ago

























          answered 4 hours ago









          Martin SmithMartin Smith

          63.6k10171254




          63.6k10171254













          • Great answer, thank you! When I first saw how they spaced out that enum I was wondering if it was something like a bitwise operation. But I'm not super experienced using that type of operation and didn't think much more into it. Cool that'll work though, thanks.

            – J.D.
            18 mins ago



















          • Great answer, thank you! When I first saw how they spaced out that enum I was wondering if it was something like a bitwise operation. But I'm not super experienced using that type of operation and didn't think much more into it. Cool that'll work though, thanks.

            – J.D.
            18 mins ago

















          Great answer, thank you! When I first saw how they spaced out that enum I was wondering if it was something like a bitwise operation. But I'm not super experienced using that type of operation and didn't think much more into it. Cool that'll work though, thanks.

          – J.D.
          18 mins ago





          Great answer, thank you! When I first saw how they spaced out that enum I was wondering if it was something like a bitwise operation. But I'm not super experienced using that type of operation and didn't think much more into it. Cool that'll work though, thanks.

          – J.D.
          18 mins ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f231402%2fwhats-the-values-for-the-freq-interval-column-in-msdb-dbo-sysschedules-when-fre%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          What is the “three and three hundred thousand syndrome”?Who wrote the book Arena?What five creatures were...

          Gersau Kjelder | Navigasjonsmeny46°59′0″N 8°31′0″E46°59′0″N...

          Hestehale Innhaldsliste Hestehale på kvinner | Hestehale på menn | Galleri | Sjå òg |...