Click here to Skip to main content
Rate this: bad
good
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
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
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
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 370
1 Prakriti Goyal 177
2 Sergey Alexandrovich Kryukov 155
3 jlopez788 134
4 _Amy 110
0 OriginalGriff 6,762
1 Sergey Alexandrovich Kryukov 5,539
2 Maciej Los 3,479
3 Peter Leow 3,323
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 3 Feb 2013
Copyright © CodeProject, 1999-2014
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