RSS Forums RSS
Please support our MS SQL advertiser: Programming Forums

Autonumber in a SQL Server table

Join Date: Jun 2005
Posts: 12
Reputation: relawson is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
relawson relawson is offline Offline
Newbie Poster

Re: Autonumber in a SQL Server table

  #7  
Jun 12th, 2005
Originally Posted by Troy
I don't know that Oracle thinks it is a bad thing, they just choose to solve the problem a different way--with "sequences". In Oracle, as you may know, a sequence is it's own thing outside of any table. Personally, I wish the databases I work with had both an autonumber/identity and a feature like a sequence. They are both very handy. A sequence can be useful if you need a way to have an id unique across multiple tables or multiple databases.

It's easy enough to code your own sequence-like feature using a one column/one row table and a function, but I assume Oracle's sequence feature is highly optimized to do what it does.

Perhaps I don't understand the functionality of the sequence clearly, how exactly are you to you use the sequence if it isn't attached to an individual entity? Or are you saying the sequence is like a counter maintained at the DB level which updates a regular identifying entity? If that is the case, that seems great.

Unfortunately the Oracle database I am working on at work for a supply chain application is so de-normalized I don't think uniqueness was too much of an issue when designing the schema.

I don't understand why people still design tables which uses multiple columns to create a unique primary key, each column by itself being non-unique. They must have been out back smoking pot during that class. :eek:

We have serious data integrity problems, as you can imagine.
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:47 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC