Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
hacktothefuture
Starting Member
10 Posts |
Posted - 2007-07-23 : 12:26:16
|
I have a design question that I was hoping you all can help with.When I normally design a table I always make sure to include a status field. This way I can "delete" a record without actually having to delete it, just update the record to a status which signifies deleted. This ensures my users have an undelete capability as well as safesguarding against the "mad clickers" which click right through the "You are deleting this record..." alerts.I have been recently adding tables which have temporary records and are meant to expire at a certain date. I have designed these tables to have an expiration date field AND a status field.My question is this: What is the normal convention relating to these types of records/tables? Should queries using these types of tables query them using the status AND the expiration date? Should you create a job that updates the records status based on the expiration date being passed. Should you use a view that only displays current records based on expiration date?I just want to make sure Im following standard practice as I design these types of tables.Thanks for your help! |
|
X002548
Not Just a Number
15586 Posts |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-07-23 : 16:00:52
|
probably better to rewrite it to an AND:where the Status <> 'deleted' AND ExpirationDT < GetDate()_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
X002548
Not Just a Number
15586 Posts |
|
hacktothefuture
Starting Member
10 Posts |
Posted - 2007-07-24 : 11:34:25
|
Awesome! Thanks for your help! |
 |
|
|
|
|