From: Lennon Day-Reynolds Date: 2004-07-29T14:57:41+09:00 Subject: Re: Stupid ODBC! On Thu, 29 Jul 2004 10:02:25 +0900, Nathaniel Talbott wrote: [...] > Then I don't understand something about your request; you said you were > looking for: > > standard way of getting an identifier for the last row inserted > If a row is expected to have an identifier, then it's going to have to > have an identity column. I believe other databases, such as Postgres > and MySQL, don't force you to have an identity column, either, so I > don't see what makes SQL Server any more onerous than other databases > (in this regard; I have lots of other reasons to hate it if you need > some). > > Am I missing some context here on Active Record? The SQL Server concept of IDENTITY is different from a ROWID (as in Oracle, Postgres, etc.), as it is an *optional* type, much like a primary key is optional. This is only an issue becuase of the requirements of Active Record; namely, the fact that an Active Record object needs a persistent, unique identifier, even if the underlying database table row doesn't have one. In Postgres et. al., that's easy, since the internal value that the database engine uses to refer to a row is accessible via the afore-mentioned DBMS-specific functionality. SQL Server still *uses* a globally unique id to refer to each row in a database, it just doesn't expose that value to client applications through ODBC. Lennon