Need Help With Timed Stored Procedure!

  • I am admittedly a very new newbie to SQL Server and I wonder if someone could help me out with what is probably a quite simple problem.

    I have 2 tables which, for reasons I won't get into, run the risk of having incorrect data left in them after some ASP stuff. The tables are named SCHEDULE and COURSE_TEMP. The COURSE_TEMP table holds, obviously, temporary course registration information, one field of which is the NUMBER of people being registered, as well as a COURSE_ID and a DATETIME. The SCHEDULE table holds info about the course including the field SEATS_AVAIL and COURSE_ID.

    What I need is a procedure (or a better way) that will check the COURSE_TEMP table periodically (say every 30 mins) and if there are records that are more than 30 mins old, take the number in NUMBER and roll back the number of SEATS_AVAIL for that particular course. Then I need the record removed from the COURSE_TEMP table.

    Any help would really be appreciated. I'm kind of on a time restraint which is why I'm looking for help here. THANKS!!!

  • It sounds like you have a good idea of the operations that need to be performed. So, for now we'll make the assumption you can code the stored procedure. To learn how to kick of a proc on a schedule, search SQL Server Books Online for the phrase: creating jobs. If you need some help with the proc itself, give another shout.

    HTH

    SJTerrill

  • i think you make a scedule to this Stored Procedure to run every 30 minutes daily...

    you must know how to make a job ..

    Alamir Mohamed

    Alamir_mohamed@yahoo.com


    Alamir Mohamed
    Alamir_mohamed@yahoo.com

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply