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

show generated Autonumber on successfull Insert! 2

Status
Not open for further replies.

rajkum

Programmer
Jul 30, 2003
48
US
Hi,
I have a Stored Proc for inserting Data from the Web into a table with a Identity column.
i want to show back the autoNumber created to the User on successfull insert.
Please help!!

Thanks,
Raj
 
also have a look at scope_identity(), which might be more suitable, depending (there's an example in BOL)
 
Never use @@identity to return the inserted value of a stored procedure. Scope_identity() will keep it to the scope of the stored procedure @@identity will not and will return the identity filed from another table if there is a trigger on the table that inserts to a second table with an identity value.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top