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.

Signature
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!
*************************************************
> Say I have a procedure that returns a return code like the following...
>
[quoted text clipped - 9 lines]
> 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!
With ADO.NET you need to set the Parameter Direction property to indicate
that this is a ReturnValue. The parameter name is irrelevant--you could call
it @Fred as long as the Direction is set to ReturnValue (based on the
intellisense choices).

Signature
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
> Say I have a procedure that returns a return code like the following...
>
[quoted text clipped - 9 lines]
> 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!