Click here to Skip to main content
15,893,668 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a table (tblMessage) with columns (id, title, contents, publishingDateTime, status). The publishingDateTime column is the Date in which the message will publish. I want to change the value of column (status) automatically from (pending to published - OR - from false to true) when it is reached to its publishingDateTime.

How it is possible in Sql Server 2005?
Posted

1 solution

Hi,

You need to change the status column in the table to a calculated field. This will need to be calculated like:

SQL
Case when publishingdatetime

This will result in 0 if pending or 1 if published.

If you prefer you can replace the 0 and 1 in the calculation to pending or published and then the status column will return the text instead
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900