Imagine I have this stored proc
CREATE PROCEDURE ReturnSomething
AS
RETURN 4
In my ExecuteSQL task I would do this
declare @rtn int
exec @rtn = ReturnSomething
select @rtn as SomethingReturned
You map the SomthingReturned to an Output GlobalVariable
--
--
Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org
"TMN" <tmn313 (AT) hotmail (DOT) com> wrote
Quote:
I know how to pass values in as parameters to a stored procedure and
receive
the resulting recordset using global variables. What I need to capture is
the return code from the stored procedure as that's where our error codes
are kept. How do you capture a "return" statement's value in a stored
procedure using a DTS SQL Task? |