OK, here is what I have.
Proc1 defines some variables within it, say one is @.Amount1 and
@.Amount2. (These are not parameters passed to proc1, they are
variables within it)
Proc2 is defined to take some parameters, the last of which are defined
as output parameters: @.Amt1, @.Amt2.
When executing Proc2 from VB.NET code, I can access the output
parameters @.Amt1 and Amt2 fine.
When I try executing the stored procedure from another stored procedure
(passing the same values as I did in .net) I get null values for Amt1
and Amt2.
I copied proc1 into Query Analyzer. Here is what the line looks like
****************************************
***
EXEC proc1 @.CheckDate, @.PersonID, @.Amount1, @.Amount2
select @.Amount1
*************************************
The "Select @.Amount1" returns a null value.
Any ideas?It is better to always name the parameters when executing a stored
procedure.
Specify the the last 2 parameters are OUTPUT:
EXEC proc1
@.chkDate = @.CheckDate,
@.persID = @.PersonID,
@.amt1 = @.Amount1 OUTPUT,
@.amt2 = @.Amount2 OUTPUT
<standish22@.hotmail.com> wrote in message
news:1128708942.876292.12040@.f14g2000cwb.googlegroups.com...
> OK, here is what I have.
> Proc1 defines some variables within it, say one is @.Amount1 and
> @.Amount2. (These are not parameters passed to proc1, they are
> variables within it)
> Proc2 is defined to take some parameters, the last of which are defined
> as output parameters: @.Amt1, @.Amt2.
> When executing Proc2 from VB.NET code, I can access the output
> parameters @.Amt1 and Amt2 fine.
> When I try executing the stored procedure from another stored procedure
> (passing the same values as I did in .net) I get null values for Amt1
> and Amt2.
> I copied proc1 into Query Analyzer. Here is what the line looks like
> ****************************************
***
> EXEC proc1 @.CheckDate, @.PersonID, @.Amount1, @.Amount2
> select @.Amount1
> *************************************
> The "Select @.Amount1" returns a null value.
> Any ideas?
>|||EXEC proc1 @.CheckDate, @.PersonID, @.Amount1 OUTPUT , @.Amount2 OUTPUT
http://www.support.microsoft.com/?id=262499
--
Andrew J. Kelly SQL MVP
<standish22@.hotmail.com> wrote in message
news:1128708942.876292.12040@.f14g2000cwb.googlegroups.com...
> OK, here is what I have.
> Proc1 defines some variables within it, say one is @.Amount1 and
> @.Amount2. (These are not parameters passed to proc1, they are
> variables within it)
> Proc2 is defined to take some parameters, the last of which are defined
> as output parameters: @.Amt1, @.Amt2.
> When executing Proc2 from VB.NET code, I can access the output
> parameters @.Amt1 and Amt2 fine.
> When I try executing the stored procedure from another stored procedure
> (passing the same values as I did in .net) I get null values for Amt1
> and Amt2.
> I copied proc1 into Query Analyzer. Here is what the line looks like
> ****************************************
***
> EXEC proc1 @.CheckDate, @.PersonID, @.Amount1, @.Amount2
> select @.Amount1
> *************************************
> The "Select @.Amount1" returns a null value.
> Any ideas?
>|||AWESOME! thanks guys.
No comments:
Post a Comment