Re: Non-skipping IDs with Master-Detail



I am suggesting you to reconsider DB design like this:

1. Make OrderNo autoinc field but not primary key

2. Append OrderID field of type GUID and make it a primary key

3. Add FK OrderID to OrderDetail and remove old FK on OrderNo.



This way you will be able generate OrderID values on the client side without
bothering server and keep proper Master-Detail relationship. As for non
skipping id it will be handled to you by the auto increment OrderNo field.



Regards,

Vitali


.



Relevant Pages

  • Re: Non-skipping IDs with Master-Detail
    ... Thanks Vitali! ... How do I make OrderID of type GUID? ... Add FK OrderID to OrderDetail and remove old FK on OrderNo. ...
    (borland.public.delphi.database.ado)
  • Re: Doubling the order
    ... Other than the orderId, there is nothing to say that two orders are the ... > 1.PRODUCTID) - primary Key ... >> relational database and it is not the best one. ... the gap in the sequence is not filled in and the sequence ...
    (microsoft.public.sqlserver.programming)
  • Re: Allen Brownes Copying forms/Subforms
    ... Is OrderID the primary key? ... Allen Browne - Microsoft MVP. ... perhaps the duplicate is on another field where you specified a "No ...
    (microsoft.public.access.modulesdaovba)
  • Re: Allen Brownes Copying forms/Subforms
    ... The "OrderID" is the primary key. ... Allen Browne - Microsoft MVP. ... perhaps the duplicate is on another field where you specified a "No ...
    (microsoft.public.access.modulesdaovba)
  • Re: Clustered vs Non-Clustered
    ... > either leave OrderId as clustered ... > OrderNumber ... > couldn't that be set as the primary key ?. ... >> OrderDate smalldatetime NOT NULL, ...
    (microsoft.public.sqlserver.programming)