Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8927247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:10:35+00:00 2026-06-15T08:10:35+00:00

Since Windows Azure doesn’t have SQL Agent you’ll have to create your own worker

  • 0

Since Windows Azure doesn’t have SQL Agent you’ll have to create your own worker role to work like a SQL Agent in order to schedule the running of an stored procedure.

Well I’m all set with this part except of the part with the dates. This should be very logic, but it doesn’t seems so to me. So how do I check if today is the first day of the month and the first day of the week.

This is what I have so far:

Trace.WriteLine("SqlWorkerRole entry point called", "Information");

while (true)
{
    DateTime firstDayOfMonth = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, 1, 0, 0, 0);
    if (DateTime.UtcNow > firstDayOfMonth)
    {
        Guid? jobId = StartJob("MonthJob");

        if (jobId.HasValue)
        {
            Trace.WriteLine("Working", "Information");
            ExecuteMonthJob();
            StopJob(jobId.Value);
        }
    }
    else
    {
        Thread.Sleep(60000);
    }

    DateTime firstDayOfWeek = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, 1, 0, 0, 0);
    if (DateTime.UtcNow > firstDayOfWeek)
    {
        Guid? jobId = StartJob("WeekJob");

        if (jobId.HasValue)
        {
            Trace.WriteLine("Working", "Information");
            ExecuteWeekJob();
            StopJob(jobId.Value);
        }
    }
    else
    {
        Thread.Sleep(60000);
    }
}

I need help with this parts (first day of month)

DateTime firstDayOfMonth = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, 1, 0, 0, 0);
if (DateTime.UtcNow > firstDayOfMonth)

and (first day of week)

DateTime firstDayOfWeek = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, 1, 0, 0, 0);
if (DateTime.UtcNow > firstDayOfWeek)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T08:10:37+00:00Added an answer on June 15, 2026 at 8:10 am

    Well, you could as an alternative use Enzo Cloud Backup Community Edition (free software). It has a scheduler built-in (that requires a x-small worler role) and you can schedule T-SQL calls. The scheduler can do weekly, but at this time it doesn’t do monthly; still it would be trivial in the stored proc itself to add logic to determine if your proc ran this month or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 Windows Azure Worker Roles, and 1 Cloud Drive VHD (for Lucene.NET
I have a ASP MVC4 Windows Azure application. The application is working but since
We have a Windows Azure Web Role on two extra-small instances that has been
since Windows Vista there is an new Win32-API call CreateSymbolicLink to create a symbolic
I have been quite comfortable with windows-services, I have been practicing since from last
I have been looking at the Kinect for Windows release notes and features, since
Since Windows doesnt have a C++ locale with UTF8 support by default, i would
Since Windows Media Player 6.1, Windows has its' own mp3 decoder. Can I use
I know that Windows has supported supplemental planes since Windows XP. I have fonts
Does anyone know if the Windows Azure Drive feature is officially RTM? I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.