Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get newest primary key immediately after db insert

Status
Not open for further replies.

new2unix

Programmer
Feb 5, 2001
143
US
Hi,

How would I retrieve the newest primary key (an autonumber field in a SQL7 db) immediately after a conn.execute insert command is executed?

Thanks,

Mike
 
Look into using the @@Identity property. Searching this forum for '@@Identity' will give you many results, like thread709-638213.

zemp
 
Please see this thread too ...

thread183-906124

I was standing in the park, wondering why frisbees got bigger as they came closer... then it hit me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top