Is there a standardized way I can create a table in SQL with a column (lets call it ID) that is auto incremental so that I can basicly use it in all databases?
(e.g. standardized in SQL-92) If so - how? If not, why? I think auto_increment is a very often used property so I thought it is very important to standardize it...
Nope, sorry. There is AUTO_INCREMENT in MySQL, but e.g. in MS SQL this is called IDENTITY. Many things are not really standardized in SQL - and most are in the schema creating area.
It's a mess, but you can use stuff like e.g. Hibernate/NHibernate to try to use a single code base.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With