List:General Discussion« Previous MessageNext Message »
From:Arthur Fuller Date:February 22 2012 1:57pm
Subject:Re: Removing Data Duplicacy
View as plain text  
I agree with the testicular remedy, but in the case of the iron codpiece, I
can think of another approach which may work for you. It still uses Select,
but reads a one-row table, so it shouldn't hurt performance much. The table
serves no other purpose than storing the next available PK; call the table
NextPK, say. The algorithm might go like this:

1. Lock the table NextPK.
2. Select its value.
3. Update the column with current value + 1.
4. Unlock the table.
5. Do your inserts.

The lock will be very brief, perhaps brief enough to satisfy your
requirement.

-- 
Arthur
Cell: 647.710.1314

Only two businesses refer to their clientele as users: drug dealing and
software development.

-- Arthur Fuller

Thread
Removing Data DuplicacyAdarsh Sharma22 Feb
  • Re: Removing Data DuplicacyJohan De Meersman22 Feb
    • Re: Removing Data DuplicacyArthur Fuller22 Feb
      • Re: Removing Data DuplicacyJohnny Withers22 Feb
      • Re: Removing Data DuplicacyAdarsh Sharma23 Feb
        • Re: Removing Data DuplicacyJohan De Meersman23 Feb
Re: Removing Data DuplicacyJohnny Withers22 Feb
  • Re: Removing Data DuplicacyJohan De Meersman22 Feb