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
 Transact-SQL (2000)
 Return value for sp

Author  Topic 

oepirobo
Starting Member

36 Posts

Posted - 2004-08-12 : 16:00:02
When I program a block of code to interact with a stored procedure I use the parameter @RETURN_VALUE to capture the number of affected rows which I believe is @@ROWCOUNT. Is there a way to change this so RETURN_VALUE gives me the value of @@IDENTITY instead of @@ROWCOUNT?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-08-12 : 16:06:44
???

SET @RETURN_VALUE = @@IDENTITY

Beware of @@IDENTITY though. You should investigate SCOPE_IDENTITY() instead.

Tara
Go to Top of Page
   

- Advertisement -