I believe one of the reasons is that many times you want to know the ID of your new record. For example, you inserted a new file to the 'files' table, and you would like to store a reference to it in your xyz table.
For mysql there is mysql_insert_id(), but not for others.
On Wednesday 25 April 2007 10:29, Ezra B. Gildesgame wrote:
> I happened to discuss this with Greg Knaddison yesterday.
> MySQL 4 does not support auto-incrementing columns.
I must respectfully disagree. I happened to have a copy of the MySQL
reference book from version 3.22 sitting on my bookshelf, and AUTO_INCREMENT
was supported even then. :-) Never mind the question of why I still have such
an old book....
I also checked a PostgreSQL reference book, and they offer a SERIAL
column type that works very similarly to the AUTO_INCREMENT in MySQL. I don't
know how far back this support goes; my book is for PG version 8.something and
was copyright 2006.
I can't comment on the Microsoft SQL Server implementation of this, if any,
because I don't have any manual for that here.
Scott
--
-------------------------------------------------------------------------------
Syscrusher (Scott Courtney) Drupal page: http://drupal.org/user/9184
syscrusher at 4th dot com Home page: http://4th.com/