Solved

Help with a trigger - calculated column

Posted on 2013-10-22
5
223 Views
Last Modified: 2013-10-22
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?
0
Comment
Question by:HLRosenberger
  • 3
  • 2
5 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 39590925
>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
 
LVL 1

Author Comment

by:HLRosenberger
ID: 39590988
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
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 39591027
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
 
LVL 1

Author Comment

by:HLRosenberger
ID: 39592298
Ah, so calculated should work then,   Thanks.
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 39592299
thanks.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now