[dba-SQLServer] Update Foreign Keys

Francisco Tapia fhtapia at gmail.com
Fri Jul 15 10:35:52 CDT 2011


SQL right?
  Have him create a trigger so that data is also inserted at every
overwrite to the audit table.

Sent from my mobile

On Jul 15, 2011, at 8:33 AM, David McAfee <davidmcafee at gmail.com> wrote:

> Yes. I do it for our rebates and incentives, here at my current job.
>
> It make it so nice to be able to see what a price/incentive was on a given
> date.
>
> I keep trying to get another developer to move his seller/customer
> assignments over to this model.
>
> He feels it is too confusing and just keeps sticking to "live" overwriting
> data.
>
> It sucks when someone needs to interface our systems, as there is no
> historical data on his end.
>
>
>
> On Fri, Jul 15, 2011 at 6:53 AM, Arthur Fuller <fuller.artful at gmail.com>wrote:
>
>> That is my preferred approach. A while back I wrote a piece for Simple-Talk
>> on PITA (Point In Time Architecture, not the other meaning, although it is
>> somewhat appropriate too :). In the case I was discussing, nothing was ever
>> updated, other than its EndDate value. A case in point: throughout your
>> life, you might change family physicians, for any number of reasons. On the
>> other hand, you may need your medical history while you were with doctor
>> 123, from 2004 to 2007. Since then you've hand two other family doctors.
>> Sometimes you need a PIT, sometimes you need all the data,
>>
>> A,
>>
>> On Fri, Jul 15, 2011 at 9:46 AM, David McAfee <davidmcafee at gmail.com>
>> wrote:
>>
>>> Create a junction table for installs.
>>>
>>> tblInstalls
>>> InstalledID (PK, INT)
>>> LocationID (FK, int)
>>> MachineID (fk, int)
>>> Installdate
>>> EntryDate
>>> Entryuserid
>>>
>>> Every record is an insertion.
>>> You never have to overwrite data.
>>> Built in history.
>>>
>>> A simple view/sproc using Max() can show the latest location location for
>> a
>>> given machine or machines at a given location.
>>>
>>> HTH,
>>> David
>>>
>>>
>> _______________________________________________
>> dba-SQLServer mailing list
>> dba-SQLServer at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>> http://www.databaseadvisors.com
>>
>>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
>



More information about the dba-SQLServer mailing list