Click here to Skip to main content
15,920,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need a trigger that updates a table row field by checking date that is store in there own filed without any interaction of user. i.e i am working on a project where i have to book rooms for user for a particular date n time and at that case i wnt to show room status as a "booked" but after expiry of that date n time our database automatically update room status "booked" to "available". means i want that database keep track of there record and update it automatically.so please help me how i can archive it.

please help me if any one can...its urgent for me.
Thanks in advance.
Posted

1 solution

You need to create a Store Proc for your operation. Then Create a Schedule Job in your SQL Server database. Then set Schedule time to run your Store Proc after that time and set your Store Proc to Schedule command.
Instruction:
Open the SQL Server Enterprise manager for your server. Expand Management, then SQL Server agent and then click Jobs. Right-click it and choose New Job. You get a screen where you can schedule various SQL Server commands, including running SQL code. For the procedure, create a new step of type Transact SQL Script and type the name of the procedure...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900