Help with a trigger - calculated column

I have a table with an end date column and a  long value that is a status.  I want to set the status to a specific value whenever the current date is great than the end date.  I know how to create a calculated column, but that requires a value in a column to change.  How do I trigger a value change based on the current date?
LVL 1
HLRosenbergerAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
A trigger will fire when row(s) are inserted-updated-deleted, and gives the developer full control over what happens for the set of rows that are inserted-updated-deleted, and not for every row.

A calculated column is calculated on select, so in effect every time you access the column.
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
>but that requires a value in a column to change.
Explain why this matters, as it's not clear why a calculated column can not meet your requirements.
0
 
HLRosenbergerAuthor Commented:
I could be all wet.   How/when does the comparision of the end date to current date take place?  I mean what triggers that?
0
 
HLRosenbergerAuthor Commented:
Ah, so calculated should work then,   Thanks.
0
 
HLRosenbergerAuthor Commented:
thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.