| Author |
Topic |
|
insanepaul
Posting Yak Master
178 Posts |
Posted - 2011-03-22 : 10:53:19
|
| just 2 questions:1. Should most tables have these fields?'created date' 'created by''modified date''modified by'2. A person has an address and a billing address. a)Should I use 1 address table. If the addresses are the same then no point entering them twice therefore i should have another bool column if billing is the same.b) Can this address table be used for clients or suppliers address? |
|
|
NeilG
Aged Yak Warrior
530 Posts |
Posted - 2011-03-22 : 11:30:09
|
| 1. Should most tables have these fields?'created date' 'created by''modified date''modified by'Your questions all depend on whats required, but I do tend to put CreatedOn and ModifiedOn in tables just so you can find what was insert/modified on specific days |
 |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-03-22 : 12:28:18
|
| in addition to NeilG response, if your database is exposed to a single user then perhaps the columns (created/modified date and by) might not have that much importance as in the case of multi-User. In most cases these columns are introduced for Data Analysis purposes e.g. how the data has been inserted, who did it, when this happened. CheersMIK |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
insanepaul
Posting Yak Master
178 Posts |
Posted - 2011-03-22 : 12:58:47
|
quote: Originally posted by X002548 No, they should have these fields [ADD_ID] [char](12) NOT NULL, [ADD_TS] [datetime] NOT NULL, [UPDATE_ID] [char](12) NOT NULL, [UPDATE_TS] [datetime] NOT NULL ;-)If the table is NOT updateable, like as say from a feed, then there is no need.1 Address table with a type columnPrimaryBillingBothGirlfriend...;-)
regarding the address table, is this what you mean?ID,address1address2address3postcodecountryaddressType (reference an address type table)both (yes/no) |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2011-03-22 : 13:16:19
|
| Sort of...If you already had a ADDR_TYPE Column, I might add a value of Both...but that would be bad data modeling I think....The Both Column as an Indicator I guess would work, (I might Call it Billing_Ind), but again...bad data modelingBut it's a physical implementation issue...to save 2x the number of rows...so I would go with the indicator or the value "Both", or "Primary and Billing" as value in typeOK....Please don't hurt me JoeBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxWant to help yourself?http://msdn.microsoft.com/en-us/library/ms130214.aspxhttp://weblogs.sqlteam.com/brettk/http://brettkaiser.blogspot.com/ |
 |
|
|
insanepaul
Posting Yak Master
178 Posts |
Posted - 2011-03-24 : 05:21:14
|
quote: Originally posted by X002548 Sort of...If you already had a ADDR_TYPE Column, I might add a value of Both...but that would be bad data modeling I think....The Both Column as an Indicator I guess would work, (I might Call it Billing_Ind), but again...bad data modelingBut it's a physical implementation issue...to save 2x the number of rows...so I would go with the indicator or the value "Both", or "Primary and Billing" as value in typeOK....Please don't hurt me Joe
Thanks, good to hear other persons views |
 |
|
|
|