[dba-SQLServer] Update Foreign Keys

Arthur Fuller fuller.artful at gmail.com
Fri Jul 15 08:53:31 CDT 2011


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
>
>



More information about the dba-SQLServer mailing list