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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the last generated identity number for a certain table 2

Status
Not open for further replies.

miraclemaker

Programmer
Oct 16, 2002
127
GB
Hi there,
Is there a query I can run on a table that will give me the last generated identity number?
 
Thanks, but I get the message 'IDENT_CURRENT' is not a recognised function name.

I'm using SQL Server 7, could that be anything to do with it?
 
I've been having some success with Scope_Identity and @@Identity, thanks.
 
yes IDENT_CURRENT is a sql2000 function. sorry.

you will have to use something like

SELECT MAX(IDENTITYCOL) FROM table_name
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top