Databasen - Revisited

Jonathan Stowe jns at
Thu Oct 19 19:26:53 BST 2006

On Thu, 2006-10-19 at 13:01 -0500, Jonathan Rockway wrote:
> > That's an alarmingly common idiom in badly written webby code - either
> > that or trying to work out what the inserted ID was by doing SELECT
> > MAX(id) just after the insert. Racetastic.
> We have the same problem with Microsoft SQL server.  Our ODBC bridge
> requires us to SELECT MAX(id) when we want to know the insert ID.

That's a bug in your ODBC driver - one of @@IDENTITY, SCOPE_INDENTITY or
IDENT_CURRENT should work fine anywhere.


More information about the mailing list