Link to home
Start Free TrialLog in
Avatar of feesu
feesu

asked on

Timer in SQL Server 2000

Experts,
How can i have something like a timer in SQL Server 2000 that checks every fixed period of time on an expiry date in my table and set a column called 'Active' = TRUE/FALSE accordingly?
Avatar of twobitbela
twobitbela

You could set up a DTS package that would run nightly, or more often if needed.

It would need to update your table setting active = false if the expiry date is less than the current date.
Avatar of feesu

ASKER

I've never done that before. Any sample code?
ASKER CERTIFIED SOLUTION
Avatar of twobitbela
twobitbela

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i think you can create a computed column and it automatically computes the value depending on the data.

something like this

CREATE TABLE sampletable (
   expiry_date datetime,
   ISACTIVE AS case when expiry_date > getdate() then 'true' else 'false',
other fields
)