Re: Getting list of recently added IDENTITY items



I think we are getting a little off topic from the original discussion,
but I was thinking that you guys were saying to not use the identity at
all, or to maybe only use it as a secondary method of getting at the
data. But so far, you have proposed making the identity the primary key
(which it is), using it as the foreign key (which it is) and putting a
unique constraint on things that you wish to enforce uniqueness for
(which I already do).

The numbering issue is just not a problem, when users need their own
numbers we just let them type them in. 99% of the time we don't let
users see the identity values, but every now and then we do, such as
User Ids, just so we have a quick way to talk about a particular thing.
Almost all of our tables have an identity as the primary key or some
combination thereof and so far I haven't heard any reason not to do
that. You are just saying to also put a UNIQUE constraint on the
columns that need to be unique... not a problem.

My main point was just trying to determine how set you were on the
evilness of the identity column and so far what you are saying to do is
what we are currently doing...

.



Relevant Pages

  • Re: Table Design Question
    ... what would you make the primary key be for a table of ... I'm not saying that you should, by default, throw an identity ... When I do use an identity column as a primary key, ... I don't care if it is sequential. ...
    (microsoft.public.sqlserver.programming)
  • Re: Choosing Primary Key
    ... Aaron Prohaska wrote: ... > unique constraint and then a identity column as the primary key. ... > five columns that make up the unique constraint are ManufacturerID, ... I think your solution of using an IDENTITY column as the PK is the best ...
    (microsoft.public.sqlserver.programming)
  • Re: sql server blocking/locking issue
    ... I would be tempted to create an identity column on the table and cluster on ... You can add a unique constraint to replace ... the previous primary key. ... Update procedure ...
    (microsoft.public.sqlserver.server)
  • Re: Indexes and primary keys, from Delaney
    ... > Is a unique constraint as efficient than having an unneccesary ... PRIMARY KEY constraint on the column rather than a unique index ... > claim that the sequence number is unique and never reused. ... > and account number, ...
    (microsoft.public.sqlserver.programming)
  • Re: Getting list of recently added IDENTITY items
    ... or to maybe only use it as a secondary method of getting at the ... MUST also have at least one UNIQUE constraint on it's real ... Suppose I place an order with UPS and receive a tracking no 110056123. ... You are just saying to also put a UNIQUE constraint on the ...
    (comp.databases.ms-sqlserver)