7

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?

p.campbell
  • 98,673
  • 67
  • 256
  • 322
ItsPronounced
  • 5,475
  • 13
  • 47
  • 86
  • Have a .bat file run on a certain day to do this query, could work. – James Black Sep 24 '10 at 15:43
  • 1
    Why would you ever use a .bat when you can use a job that is built into SQL Server exactly for this purpose? – Matt Sep 24 '10 at 15:50
  • @matt, because you didn't read the question. sql server express doesn't come with sql server agent. ie, the thing that lets you schedule tasks in sql server. – DForck42 Sep 24 '10 at 19:55

3 Answers3

13

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)
8kb
  • 10,956
  • 7
  • 38
  • 50
0

you can make use of bat file to connect to your sql express using sqlcmd.exe and then set that bat file in windows scheduler to run it at desired time of interval.

Nishad
  • 426
  • 2
  • 7
  • 20
0

Create a job with monthly schedule in Sql Agent and assign a T-Sql task to it with this query.

Denis Valeev
  • 5,975
  • 35
  • 41
  • I don't seem to see a SQL Agent. Sorry I failed to mention this was Sql Server 2005 Express and I'm using Management Studio Express. Can I still accomplish this? Thanks! – ItsPronounced Sep 24 '10 at 16:02
  • This would be a good option if there was another non-Express SKU of SQL Server running elsewhere. – p.campbell Sep 24 '10 at 16:32
  • down voted because they didn't look up that express doesn't come with sql server agent. – DForck42 Sep 24 '10 at 19:56