title: Preventing an incorrect address being assigned when updating/inserting data into CMS system
body: <p>I'm currently building part of a basic CMS system for the company I work for. There are three main tables...</p>
  
  <p>Companies
  Customers
  Addresses</p>
  
  <p>Which are all linked to together with foriegn keys. I've noticed a glitch when using SQL Server 2005 where if I add a new lead the address maybe updated between the selection of an existing address and the creation of a company causing the company to then have the wrong address associated with it.</p>
  
  <p>My question is... how can I prevent this? Transactions? Timestamp on the address - whereby when the record is selected it gets updated and if the timestamp is different to what the update statement has it inserts a new record?</p>
  
  <p>I'm trying to write a scaleable solution as this is part of the e-commerce website. Users can update their details and much as we can ourselves.</p>
  
  <p>Help.</p>
  
  <p>Thank you.</p>