Get return code from SQL Server Sproc?

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!
 
C

Cowboy \(Gregory A. Beamer\)

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!
|
*************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top