Re: Update Status Field after Expiry Date
- From: shane.taylor81@xxxxxxxxx
- Date: 28 Mar 2007 14:21:45 -0700
Thanks to CELKO for being so critical.
1) It is pretty obvious that this cannot be the design for my actual
table, this was to simplify the post.
CREATE TABLE Customers -- plutal names for sets, pleaseThanks again from the "newbie"
( cust_id char(10)
You need to fix that at once and teach the guy that SQL has no BOOLEAN data types -- that is just sooooo >fundamental!Did not know that.
Yes and no. It's optional, so *of course* every major implementationTo CELKO : Would want your comments on this for "MS SQL Server"
deals with it differently.
http://troels.arvin.dk/db/rdbms/#data_types-boolean
Change accountStatus to
accountStatus AS (CASE WHEN accountExpirydate < getdate()
THEN convert(bit, 1)
ELSE convert(bit, 0)
END)
Works Great!!! However, I would go with CELKO's view solution. I have
to create a VIEW on that table anyways.
To CELKO:- You could have conveyed the message better by being a less
rude :(
.
- Follow-Ups:
- Re: Update Status Field after Expiry Date
- From: --CELKO--
- Re: Update Status Field after Expiry Date
- References:
- Update Status Field after Expiry Date
- From: shane . taylor81
- Re: Update Status Field after Expiry Date
- From: Erland Sommarskog
- Update Status Field after Expiry Date
- Prev by Date: connections
- Next by Date: Re: SQL Server Problem
- Previous by thread: Re: Update Status Field after Expiry Date
- Next by thread: Re: Update Status Field after Expiry Date
- Index(es):
Relevant Pages
|