Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Stored procedure and @@identity

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-11-28 : 09:09:21
Arnt writes "Your stored procedure is going to perform to things:

Insert a record in a table, and after that, send the @@identity from the table back to ASP.

I've tried it like this:
CREATE Procedure sp_NewOrder (@CID int) AS

INSERT INTO [Order] (CID)
VALUES (@CID);
Select @@identity from [Order];

When I run it in Query Analyzer it looks good, but from an ASP and ADODB.Connection; it doesn't contain the @@identity value!

I've seen your articles on retrieving it, but not in a stored procedure!"
   

- Advertisement -