Re: last_insert_id() / MSSQL
- From: mpeppler@xxxxxxxxxxx (Michael Peppler)
- Date: Fri, 29 Apr 2005 17:55:05 +0200
On Fri, 2005-04-29 at 15:08, Ing. Branislav Gerzo wrote:
> Hello all,
>
> I connect to MSSQL via ODBC, exist some method to get last inserted
> id? I read in DBI docs:
>
> For some drivers the value may only be available if placeholders have
> not been used (e.g., Sybase, MS SQL). In this case the value returned
> would be from the last non-placeholder insert statement.
>
> So I will to have using "select max($field) from $table" 'method' ?
No - just do a "select @@identity" to get the latest value.
Michael
--
Michael Peppler - mpeppler@xxxxxxxxxxx - http://www.peppler.org/
Sybase DBA/Developer
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html
.
- References:
- last_insert_id() / MSSQL
- From: Ing. Branislav Gerzo
- last_insert_id() / MSSQL
- Prev by Date: last_insert_id() / MSSQL
- Next by Date: Re: UTF8 in CSV (was Re: select through DBD::CSV)
- Previous by thread: last_insert_id() / MSSQL
- Index(es):
Relevant Pages
|
|