Re: Multiuser record lock query?

From: William \(Bill\) Vaughn (billvaRemoveThis_at_nwlink.com)
Date: 03/30/04


Date: Mon, 29 Mar 2004 16:16:06 -0800

In this case use a GUID. It's a guaranteed unique identifier that you never
have to worry about. Identity columns are useful, but in your case, since
you're (apparently) trying to keep rows in more than one table unique (not
sure why or if it makes sense in a relational database), the Identity column
(autonumber) is not a good choice. Is this a value that the user must enter?
If so, a GUID is too long. In this case (so to speak), I would generate a
table of unique numbers ahead of time and "use" these as new unique numbers
are needed. It's easy to do and fast--and there's no chance of collisions.
When a new number is needed, do a SELECT on the TOP 1 (oops JET/Access does
not support this)... the first row from this table and delete it. Of course
with JET (which I don't recommend), you'll have to purge/compress your
database from time to time to clear out the detritus.

I guess this is a silly question, but why aren't you using MSDE for this?
Aren't you worried about security, scalability, stability and speed or is
this a government project where things like that aren't important? ;)

-- 
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
"Gitendra Proctor" <gproctor@ihug.com.au> wrote in message
news:DA72049A-CECF-4BB9-86C0-C3DCF19AD0D0@microsoft.com...
> Hi!
> I am unfamilier with the term "Identity column", I looked up the
documentation and as I understand it is much like the autonumber feature in
MS ACCESS. I have used the autonumber (identity column) feature, when I
wanted an unique sequentially incremented number for one table.
>
> Here I have multiple tables, and I need a single unique sequential number
(It's a docket number) each time a record is added to any of the tables.
>
> Please let me know if this is the right interpretation of "Identity
Column". Thankyou for taking the time to answer my query.
>
> Regards
> Gitendra


Relevant Pages

  • Re: Object flow of operation
    ... > Thanks Grant but I am familiar with Guid. ... > like Y2004PUBxx and set it to an IDENTITY column and it will automatically ... >>> Check Database to see if tempID exists. ... >>> id, check its existence in the database, if it exists duplicate the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to determine GUID of newly-inserted record?
    ... You may also generate the GUIDs yourself and remove the IsRowGuid property ... you would know the GUID value before inserting ... > Since the tables currently also include an identity column, ...
    (microsoft.public.sqlserver.ce)
  • Re: Email verifacation
    ... You are right that an identity column could be stored as a much smaller ... another unrelated user or perhaps even gaining entry to another account. ... also store the GUID in a column. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Object flow of operation
    ... Thanks Grant but I am familiar with Guid. ... like Y2004PUBxx and set it to an IDENTITY column and it will automatically ... >> with a SQL IDENTITY column. ... >> Check Database to see if tempID exists. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Renumbering MS db ID?
    ... If you're using an Autonumber field or an Identity column to represent ... If you had a lot of> deletions and a scenario where you'd never have more than say 100 items in> a given table, you could safely specify the use of a TinyInt value and just> recycle things. ... We do this currently> with our employee badge system and since the license comes in one block of ...
    (microsoft.public.data.ado)