I am developing simple auction app with c# and SqlServer.
I have an Auction
entity. For simplicity it has next structure:
AuctionId
ItemId
StartPrice
StartDate
Status
CurrentPrice
BidderId
LastBiddedat
A know that it is not in normal form, it does not matter here. Not production code.
What I need is to update Auction Status
if there have not been any bids in last 2 minutes. No bids - auctions status sets to Inactive
.
I can track db changes in c# code via SqlDependency
and it works perfectly.
Now I need a mechanism to update db when auction time is up. I would like to do it on database layer for simplicity.
It can be done via SQL Agent
, there even is an example how to do it how to schedule a job for sql query to run daily? .
Maybe you have another options? Just curious.