Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 How to return @@Identity to ASP
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

q2w
Starting Member

16 Posts

Posted - 05 August 2003 :  23:58:34  Show Profile
I have a stored procedure in which the last line is:

Select RetVal = @@Identity

(This stored procedure properly returns the record ID in Query Analyzer)

In DW MX I have created a command object which also returns a recordset,
named rsGM

I'm trying to access the record id like this:

ID = rsGM("RetVal")

But I am getting an error saying, in effect, that the column does not exist.

What am I doing wrong?

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 06 August 2003 :  04:11:32  Show Profile  Visit D3mon's Homepage
Make sure all the other code in your SP is not included in the Recordset eg.

SET NOCOUNT ON

...your SP code...

SET NOCOUNT OFF


...and use this line to retrieve the value...

select @@Identity 'Retval'


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

q2w
Starting Member

16 Posts

Posted - 06 August 2003 :  10:24:09  Show Profile
Thank you. It is working now.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07