Click here to Skip to main content
13,193,405 members (52,201 online)
Rate this:
Please Sign up or sign in to vote.
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 3-Feb-13 7:34am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


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

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.171017.2 | Last Updated 3 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100