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 Nirav Prabtani 268
1 OriginalGriff 217
2 Mika Wendelius 185
3 Sergey Alexandrovich Kryukov 176
4 CPallini 170
0 Nirav Prabtani 284
1 OriginalGriff 217
2 Mika Wendelius 185
3 _Amy 170
4 CPallini 170


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