Friday, February 24, 2012

[Help] Schedule a Query

Hi. I'm a 17 year-old who is hosting a server for an online game. To store the game's data, I am using SQL Server 2005 and SQL Server Management Studio Express.

I wrote the following Query:

UPDATE Items
SET ItemID=('25')
WHERE ItemID=('200001')

It's purpose is to change an item in a player's inventory into a different item.

I would like to know how to set this Query to be executed automatically every couple of minutes. Let's say every 5 minutes.

I believe SQL 2000 had a Scheduler; but, I cannot find this in SQL 2005.

Thanks for reading this.

SQL 2005 Express does NOT have a 'scheduler' (SQL Agent).

However, read in Books Online about using SQLCmd.exe, the command line tool that will allow you to execute a stored procedure.

Combine that with Windows Scheduler, and you can reasonably 'automate' SQL code (or stored Procedures) to run on schedule.

No comments:

Post a Comment