Get newly created record's ID??

  • Thread starter Thread starter David Lozzi
  • Start date Start date
D

David Lozzi

I'm creating new records in my aspx file, but after its created, I need the ID of the new record. The ID field is the primary key and increments automatically. Should this be completed in a proc? Sorry about the cross group post, but I'm not sure where and who would know this.

Thanks!
 
You can get the last generated Identity value in your stored procedure with SCOPE_IDENTITY() on SQL Server 2000, and @@IDENTITY on SQL Server 7.

--
Jacco Schalkwijk
SQL Server MVP


I'm creating new records in my aspx file, but after its created, I need the ID of the new record. The ID field is the primary key and increments automatically. Should this be completed in a proc? Sorry about the cross group post, but I'm not sure where and who would know this.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top