Identity value after INSERT

Identity value after INSERT

Post by Dr. Holger Schluete » Thu, 10 Sep 1998 04:00:00



I need know the Identity value after an INSERT without reselecting
the row inserted.
I am currently running SQL 7.0 beta 3 using DB-LIB.

Any suggestion?

Thanks

 
 
 

Identity value after INSERT

Post by Neil Thoma » Thu, 10 Sep 1998 04:00:00



script.

- N


>I need know the Identity value after an INSERT without reselecting
>the row inserted.
>I am currently running SQL 7.0 beta 3 using DB-LIB.

>Any suggestion?

>Thanks


 
 
 

1. Retrieving IDENTITY value after INSERT

@@identity is local to your connection. The fact that it pertains to all
tables means that it will contain the last value that YOU inserted into any
table with an identity column. Anything done by other processes will NOT

Why don't you test this out using isql/w? You can open multiple connections,
have connection1 insert into a test table with an identity column, then have

connection2 inserted.

HTH

--
Kalen Delaney
MCSE, SQL Server MCT, MVP


2. Disaster Recovery Plan for Ingres

3. Identity value for inserted row

4. We are running sql 2000 enterprise on NT 2000 advanced server. The server is IBM Netfinity 8500R 8Xeon 700 cpus. we also have an IBM Enterprise storage system hooked up

5. finding identity values after insert

6. EMC -or- SSA?

7. Retrieving Identity value after inserting a record

8. Temporary # Tables

9. Getting Identity Value on Insert

10. return the current identity value after insert

11. Retrieve Identity value after insert

12. IDENTITY value in insert

13. Return Identity value from Insert into