Re: Query to set values in an ID Field

From: Val Mazur (group51a_at_hotmail.com)
Date: 08/31/04


Date: Mon, 30 Aug 2004 20:50:57 -0400

Hi,

No, there is no simple query to do this. Cannot you leave the gaps? I think
in this case you could avoid this extra coding.

-- 
Val Mazur
Microsoft MVP
"Andy DF" <PrivateType@vb.com> wrote in message 
news:cgunal$8o7$1@lacerta.tiscalinet.it...
> Hi all,
>
> I have a a table with an ID field containing incremental unique numbers 
> that
> identify single rows.
> The field is NOT auto-incremental, it's an integer field and ID's are
> handled manually by code for a series of reasons.
> After records are deleted, the ID number sequence is broken and in order 
> to
> remove holes in the number sequence I normally loop thru each row to reset
> the ID.
>
> Is there some form of a query that can do that in one call?
> In other words, is there an SQL instruction that can reset all my ID 
> fields
> in the table incrementally?
>
> Thanks a bunch,
>
> -- 
> Andy,
> pctos550@hotmail.com
>
> 


Relevant Pages

  • Query to set values in an ID Field
    ... I have a a table with an ID field containing incremental unique numbers that ... identify single rows. ... the ID number sequence is broken and in order to ... is there an SQL instruction that can reset all my ID fields ...
    (microsoft.public.data.ado)
  • Re: Group By Sequential Records
    ... Is there any way to speed up the query? ... in each "sequence" where Group and AltID are the same and ID numbers are ... remains the same throughout each "sequence". ... FROM AddrCent AS Sub ...
    (microsoft.public.access.queries)
  • Re: Doubling the order
    ... The early SQLs were based on existing file systems. ... relational database and it is not the best one. ... the gap in the sequence is not filled in and the sequence ... Since a query result is a table, and a table is a set which has no ...
    (microsoft.public.sqlserver.programming)
  • Re: Doubling the order
    ... 1.PRODUCTID) - primary Key ... > data model or any data integrity. ... the gap in the sequence is not filled in and the sequence ... > Since a query result is a table, and a table is a set which has no ...
    (microsoft.public.sqlserver.programming)
  • Re: query unique count for field
    ... I am not looking for a 1 to n sequence across the whole ... Start with such a temp table empty of ... >> Having succeeded with Michel's advice, I now have a query with the correct ... >>> where table Iotas has a single field, iota, with values from 1 to nnn, ...
    (microsoft.public.access.queries)