Hi again,Okay maybe I didn't explain myself properly in my initial post so I will try again in the hope that somebody somewhere will be able to help me out with this little problem!As I mentioned in the original post. I have a person table as follows :create table dbo.Person ( PersonId int ,Forename varchar(50) ,Surname varchar(50) ,DOB datetime ,Addr1 varchar(255) ,Addr2 varchar(255) ,Addr3 varchar(255) ,County varchar(50) ,Postcode varchar(8) )go The actual table is wider but for the sake of this question I will pretend that it's 9 columns wide.When I want to remove a person I add their details to the following table:create table dbo.LogicallyDeletedRecord ( PersonId int ,DeletedReason char(1) ,CreationStamp datetime default getdate() ) When I want to view live person records (i.e. Person records that have not been deleted), I use the following view:create view vw_LivePersonDataasselect a.PersonId ,a.Forename ,a.Surname ,a.DOB ,a.Addr1 ,a.Addr2 ,a.Addr3 ,a.County ,a.Postcodefrom dbo.Person as awhere not exists (select 1 from dbo.LogicallyDeletedRecord as b where a.PersonId = b.PersonId)go Similarly, to view dead person records (i.e. records that have logically deleted), I use the following view:create view vw_DeadPersonDataasselect a.PersonId ,a.Forename ,a.Surname ,a.DOB ,a.Addr1 ,a.Addr2 ,a.Addr3 ,a.County ,a.Postcodefrom dbo.Person as awhere exists (select 1 from dbo.LogicallyDeletedRecord as b where a.PersonId = b.PersonId)go This looks like a good design perhaps but my worry is that both the Person table and LogicallyDeletedRecord table will grow and performance will be bad when accessnig the views.Can anybody suggest a different design? I don't want to physically remove person records that are no longer active. |