Re: Utilizing Return values from Stored Procedure

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Karl Gram (NOSPAMkarl_at_gramonline.nl)
Date: 03/16/04


Date: Tue, 16 Mar 2004 15:31:14 +0100

Hi Keith,

Specify that the procedure parameter is an OUTPUT paarmeter. You must also
specify this in the parameter definition of the procedure itself:

Declare @Column char(15), @MHRID int
Select @Column='MHRID'
exec spLocal_HomeGetNextID @Column OUPUT, @MHRID

-- 
HTH
Karl Gram
http://www.gramonline.com
"Keith" <anonymous@discussions.microsoft.com> wrote in message
news:de8701c40b60$66365820$a301280a@phx.gbl...
> I'm executing a stored procedure from within a stored
> procedure.  The sp that is being called has a return
> parameter associated with it.  I need to be able to use
> that return parameter in the calling sp.
>
> In my code below: I supply a column name
> (@Column='MHRID'), and the sp returns me the nextid
> (@MHRID)
>
> *****************************************************
> Declare @Column char(15), @MHRID int
> Select @Column='MHRID'
> exec spLocal_HomeGetNextID @Column, @MHRID
> *****************************************************
>
> I just can't figure out the correct syntax / method of
> using the returned parameter.
>
> (Please don't comment on why I'm assigning ID's in this
> manner ---that's a different issue)
>
> Thanks,
>
>
> Keith
>


Relevant Pages

  • Re: Utilizing Return values from Stored Procedure
    ... exec spLocal_HomeGetNextID @Column, @MHRID OUTPUT ... "Keith" wrote in message ... > I'm executing a stored procedure from within a stored ...
    (microsoft.public.sqlserver.server)
  • Re: noise words, @@ERROR, and stop and resume indexing
    ... EXEC sp_fulltext_catalog 'adsfull', 'stop' ... > 1) check noise words inside stored procedure ... > can be solved by changing the language specific file with noise words ... ...
    (microsoft.public.sqlserver.fulltext)
  • source text file as input parameter from a stored procedure
    ... I am using an active X script in combination with a global ... transform task that loads data from a .txt file to a table. ... I can also tell that the stored procedure is correctly passing in the ... EXEC sp_OAGeterrorinfo @object, @hr ...
    (microsoft.public.sqlserver.dts)
  • Re: Repeating 3 Datapump actions between the same datasource/destinati
    ... How to loop through a global variable Rowset ... > exec p_PullDataForDates1 20050101,20050131 ... > task that configure the SourceSQLStatement for the 2 pumps (to fill in the ... > blanks for the stored procedure parameter). ...
    (microsoft.public.sqlserver.dts)
  • Re: Stored Procedure Fails Only When Called By Agent
    ... Stored Procedure 1: ... EXEC sp_addlinkedserver '10.1.2.10', 'SQL Server' ... LOCALMACHINE\myaccount/pass3, the same account that owns the job. ...
    (microsoft.public.sqlserver.replication)