User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 392,305 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,844 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:

Autonumber in a SQL Server table

Join Date: Jun 2005
Location: Kansas City, Missouri, USA
Posts: 344
Reputation: Troy is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 4
Troy's Avatar
Troy Troy is offline Offline
Posting Whiz

Re: Autonumber in a SQL Server table

  #6  
Jun 11th, 2005
Originally Posted by relawson
You know, this feature isn't in Oracle as I recently discovered. Is it considered bad to use autoincrementing numbers? Certainly makes it easy to maintain a primary key with little effort. I am just trying to understand in what situation you wouldn't want to use that feature. Obviously Oracle doesn't seem to want you to use it at all.

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.
Troy Wolf is the author of SnippetEdit. "Website editing as easy as it gets." IX Web Hosting
Reply With Quote  
All times are GMT -4. The time now is 10:06 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC