Get return code from SQL Server Sproc?

  • Thread starter Thread starter Smokey Grindel
  • Start date Start date
S

Smokey Grindel

Say I have a procedure that returns a return code like the following...

CREATE PROCEDURE TestProc
AS
BEGIN
SET NOCOUNT ON;
SELECT *
FROM MyTable;
RETURN 10
END


And I execute that in a sql command object, how does my client application
get the return code back? Which in this case is 10.. thanks!
 
Create a parameter for @RETURN_VALUE. It will automatically be connected to
the return statement. With SQL Server 7 or earlier, it is merely
RETURN_VALUE, but I doubt many of us are still in that world.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************************************************
| Think outside the box!
|
*************************************************
 
Back
Top