Monday, 2 September 2013

How can I make a SQL-script run after a certain time without waiting for it?

How can I make a SQL-script run after a certain time without waiting for it?

I'm trying to make a SQL-script delayed.
I could use:
blah blah
WAITFOR DELAY '00:30:00'
blah blah
but using a script like this requires that I sit through the 30 minutes.
Leaving the website will cancel the script.



The problem is that I want to change something in a table, and then change
it back automatically 30 minutes later.
The person making the change will leave the webpage, so any kind of
client-side script is out of the question.
Nor can I wait for the person to return and make the change if 30 minutes
have passed, the change must happen after 30 minutes regardless.



Is there anyway to do this without making a service or any other program
on the server?
Using only ASP/SQL programming.



If this is impossible, how do I make a service or program on the server to
make this change?
Must be able to start this from the website using ASP.

No comments:

Post a Comment