I need to schedule some queries to run at the beginning of every month (for monthly reports) and I read that creating a JOB in sql server 2008 was the way to go. Unfortunately, I don't have the rights/privileges to use SQL Server Agent at this time. Is there another way of scheduling a few queries to run the first day of every month?

I am running Sql Server 2008 R2 on Windows Server 2008 R2 Standard operating system.

  • What do you want to do with the output of the queries? Look at it, send it to a file, or ...?
    – automatic
    Mar 9, 2012 at 15:09
  • 3
    If these genuinely are reports, why not write them in reporting services (RS) and set up a monthly subscription for them? That functionality is built into RS. Mar 9, 2012 at 15:13
  • the output of the queries would ideally be saved as excel files or as .csv files. @Damien_The_Unbeliever I don't know why I didn't think of that. I will give that a try.
    – JuanVelez
    Mar 9, 2012 at 15:26
  • If the point of running the query is to make an xl/csv once a month and send it to people, then RS is the way to go. Create a report in reporting services that generates the results you want, and then create a subscription that sends it to the right people on the right days. (once a month is one of the options).
    – jerry
    Mar 9, 2012 at 21:18

4 Answers 4


SQL Jobs is indeed the right way about it.

If you don't have the permissions, talk to your manager/DBA in order to set up the job.

If this is not possible, you can use the task scheduler in conjunction with sqlcmd to execute queries on the SQL Server.

Another alternative is to write a windows service that will execute these queries, but in terms of scheduling I would trust the task scheduler over custom code.

  • Thanks for the suggestions. I'll try talking first to the DBA (but hes new on the job so he's a little paranoid and thinks that any little thing will cause the serve to explode! lol) if i still cant get the permissions then i'll try one of the other methods you have listed.
    – JuanVelez
    Mar 9, 2012 at 15:32

Sql Server Agent really is the best way to do it so try and get access if you need it.

If you have to, you could create a 'hack' - one possible way is to find a stored proc that you know gets called at least daily and add a final step in there to check if DATEPART('dd', getdate()) = 1. If so, call your other proc that you'd like to be 'scheduled'.

Ugly, but would work if needed!

  • hehehe cool, I'll keep that in mind in case all else fails.
    – JuanVelez
    Mar 9, 2012 at 15:28

If you absolutely cannot use SQL jobs to do it, you could use C# to write a program which connects to the database and runs the queries. Then, compile this program into an executable and write a batch job which runs the executable from Windows Task Scheduler.


We use AutoSQL in our office. It requires no access to specific services, only a connection to SQL server and task scheduler. It's user friendly and outputs to Excel, CSV and email.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.