From: npoly_iki@... (Iki) Date: 2004-07-29T17:51:44+09:00 Subject: Re: Stupid ODBC! At least for the MSSQL server I think the most appropriate query is select SCOPE_IDENTITY() just after the insert statement. You could also use select IDENT_CURRENT('table_name') but I suspect this isn't appropriate due to concurrency issues. Keep up the good work and let us know about the ODBC adapter. I for one could use it to try out ActiveRecord on Windows. Actually I am a bit surprised that it wasn't the first adapter built. Nathaniel Talbott wrote in message news:... > On Jul 28, 2004, at 18:38, Lennon Day-Reynolds wrote: > > > The problem is that it appears that SQL Server (and most like the Jet > > engine, too) has *no* way to get said information -- if you want a > > 'rowid', it has to be in your table schema. > > Here's the code I used for SQL Server: > > SELECT @@identity > > I forget all the forms of that, and the exact scope it operates in, but > it should at least get you started. > > HTH, > > > Nathaniel > Terralien, Inc. > > <:((><