Solved

Help with a trigger - calculated column

Posted on 2013-10-22
5
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

Question has a verified solution.

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

Suggested Solutions

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how the fundamental information of how to create a table.

756 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