Fog Creek Software
Discussion Board




See return value from Stored Proc in Query Anal

I have the following stored proc:

create procedure sp_PubsTest
  @intID int
AS
SELECT @intID = @intID + 1
RETURN @intID

If I execute the proc in the Query Analyzer I just get back "command completed successfully".  How can I see the return value?

Ted Graham
Tuesday, July 22, 2003

Figured it out:

declare @return int
exec @return = sp_PubsTest @intID=1
select @return as 'return'

Ted

Ted Graham
Tuesday, July 22, 2003

Which database are use using - I assume SQL Server, but then which version and Microsoft or Sybase.

I also assume that there are better place to ask this question with more knowledgeable users.

RocketJeff
Tuesday, July 22, 2003

Yes, please take your questions elsewhere. This area is reserved for disgruntled employees, and unemployed individuals asking "Should I do a followup call?". We like to call this place the "Disgruntled and Disaffected Outsiders Club". Quit bugging us!

Anonymizer
Tuesday, July 22, 2003

*  Recent Topics

*  Fog Creek Home