Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

automate a SQL query to run every month

I have a simple SQL query that updates some date fields in a record, on a SQL Express instance.

I'd like to have it run automatically every month. What is the best way of accomplishing this in SQL Server 2005 Express using the Management Studio?

like image 869
ItsPronounced Avatar asked Sep 24 '10 15:09

ItsPronounced


People also ask

How do I schedule a SQL query to run monthly?

In the 'Steps' window enter a step name and select the database you want the query to run against. Paste in the T-SQL command you want to run into the Command window and click 'OK' . Click on the 'Schedule' menu on the left of the New Job window and enter the schedule information (e.g. daily and a time).

Can I schedule a SQL query to run automatically?

Click Start automatically when SQL Server Agent starts to start the job when the SQL Server Agent service is started. Click Start whenever the CPUs become idle to start the job when the CPUs reach an idle condition. Click Recurring if you want a schedule to run repeatedly.


1 Answers

For SQL Server Express, there are a few possibilities. Unfortunately none of them involve Management Studio:

  1. Use a combination of Windows Scheduler, sqlcmd.exe, and .bat files
  2. Use SQL Server Service Broker
  3. Use a Codeplex variation of SQL Agent
  4. Use SQL Scheduler (free download)
like image 75
8kb Avatar answered Oct 14 '22 00:10

8kb