Stored procedure - OUTPUT parameters are default if first one set to NULL

Stored procedure - OUTPUT parameters are default if first one set to NULL

Post by Lee Atkins » Thu, 11 Dec 2003 13:31:11



Hi - if I have a SP

CREATE PROCEDURE Test
(


)
AS



However, if the SP is:

CREATE PROCEDURE Test
(


)
AS




Many thanks for your help

 
 
 

Stored procedure - OUTPUT parameters are default if first one set to NULL

Post by Jacco Schalkwij » Thu, 11 Dec 2003 13:44:30


How do you output that? I just tested it and this works fine:

CREATE PROCEDURE Test_p

)
AS


GO




GO
DROP PROCEDURE Test_p

--
Jacco Schalkwijk
SQL Server MVP


> Hi - if I have a SP

> CREATE PROCEDURE Test
> (


> )
> AS



> However, if the SP is:

> CREATE PROCEDURE Test
> (


> )
> AS




> Many thanks for your help


 
 
 

Stored procedure - OUTPUT parameters are default if first one set to NULL

Post by Lee Atkins » Fri, 12 Dec 2003 20:32:08


Hi Jacco - I am running the SP in the Visual Studio .NET IDE - it
works OK in Query Analyzer. So although there looks like a problem in
the IDE, it can't be the reason I have a bug in my own code :(

Thanks very much for your help.


> How do you output that? I just tested it and this works fine:

> CREATE PROCEDURE Test_p
> (


> )
> AS


> GO




> GO
> DROP PROCEDURE Test_p

> --
> Jacco Schalkwijk
> SQL Server MVP



> > Hi - if I have a SP

> > CREATE PROCEDURE Test
> > (


> > )
> > AS



> > However, if the SP is:

> > CREATE PROCEDURE Test
> > (


> > )
> > AS




> > Many thanks for your help

 
 
 

Stored procedure - OUTPUT parameters are default if first one set to NULL

Post by Steve Kas » Fri, 12 Dec 2003 20:45:56


Lee,

  How are you supplying the parameters and returning them in VS.NET?  If
I run





from VS.NET, it's fine.

SK


>Hi Jacco - I am running the SP in the Visual Studio .NET IDE - it
>works OK in Query Analyzer. So although there looks like a problem in
>the IDE, it can't be the reason I have a bug in my own code :(

>Thanks very much for your help.


>>How do you output that? I just tested it and this works fine:

>>CREATE PROCEDURE Test_p
>>(


>>)
>>AS


>>GO




>>GO
>>DROP PROCEDURE Test_p

>>--
>>Jacco Schalkwijk
>>SQL Server MVP



>>>Hi - if I have a SP

>>>CREATE PROCEDURE Test
>>>(


>>>)
>>>AS



>>>However, if the SP is:

>>>CREATE PROCEDURE Test
>>>(


>>>)
>>>AS




>>>Many thanks for your help

 
 
 

Stored procedure - OUTPUT parameters are default if first one set to NULL

Post by Lee Atkins » Fri, 19 Dec 2003 15:10:42


Hi Steve - I am opening the SP to edit, via 'Server Explorer', then
selecting 'Run Stored Procedure' from the context menu of the editor.

> Lee,

>   How are you supplying the parameters and returning them in VS.NET?  If
> I run





> from VS.NET, it's fine.

> SK


> >Hi Jacco - I am running the SP in the Visual Studio .NET IDE - it
> >works OK in Query Analyzer. So although there looks like a problem in
> >the IDE, it can't be the reason I have a bug in my own code :(

> >Thanks very much for your help.


> >>How do you output that? I just tested it and this works fine:

> >>CREATE PROCEDURE Test_p
> >>(


> >>)
> >>AS


> >>GO




> >>GO
> >>DROP PROCEDURE Test_p

> >>--
> >>Jacco Schalkwijk
> >>SQL Server MVP



> >>>Hi - if I have a SP

> >>>CREATE PROCEDURE Test
> >>>(


> >>>)
> >>>AS



> >>>However, if the SP is:

> >>>CREATE PROCEDURE Test
> >>>(


> >>>)
> >>>AS




> >>>Many thanks for your help

 
 
 

Stored procedure - OUTPUT parameters are default if first one set to NULL

Post by Steve Kas » Fri, 19 Dec 2003 15:56:36


Lee,

  I think I can reproduce your error.  I don't see any problem with the
stored procedure, but this does look like a bug in the de*/IDE.

With 'aaaa' and 'bbbb' assigned in the procedure, I see this output in VS:


No rows affected.
No more results.

Finished running dbo."Test".



No rows affected.
No more results.

Finished running dbo."Test".



No rows affected.
No more results.

Finished running dbo."Test".

If I check that the output parameters are actually correct, despite what
VS shows, by running this:





the correct values are selected in all three cases.  Here's the output
in the case that's wrong above.

Executing script ...

-------------------- --------------------
<NULL>               bbbb                
No more results.
(1 row(s) returned)
Finished executing script ...

I can bring this up with Microsoft and see if there is an explanation.

SK


>Hi Steve - I am opening the SP to edit, via 'Server Explorer', then
>selecting 'Run Stored Procedure' from the context menu of the editor.


>>Lee,

>>  How are you supplying the parameters and returning them in VS.NET?  If
>>I run





>>from VS.NET, it's fine.

>>SK


>>>Hi Jacco - I am running the SP in the Visual Studio .NET IDE - it
>>>works OK in Query Analyzer. So although there looks like a problem in
>>>the IDE, it can't be the reason I have a bug in my own code :(

>>>Thanks very much for your help.


>>>>How do you output that? I just tested it and this works fine:

>>>>CREATE PROCEDURE Test_p
>>>>(


>>>>)
>>>>AS


>>>>GO




>>>>GO
>>>>DROP PROCEDURE Test_p

>>>>--
>>>>Jacco Schalkwijk
>>>>SQL Server MVP



>>>>>Hi - if I have a SP

>>>>>CREATE PROCEDURE Test
>>>>>(


>>>>>)
>>>>>AS



>>>>>However, if the SP is:

>>>>>CREATE PROCEDURE Test
>>>>>(


>>>>>)
>>>>>AS




>>>>>Many thanks for your help

 
 
 

Stored procedure - OUTPUT parameters are default if first one set to NULL

Post by Steve Kas » Fri, 19 Dec 2003 23:24:41


Lee,

  This does look like a bug in the Visual Studio IDE to me.  I've
brought it to Microsoft's attention, and I'll let you know what I find out.

SK


>Hi Steve - I am opening the SP to edit, via 'Server Explorer', then
>selecting 'Run Stored Procedure' from the context menu of the editor.


>>Lee,

>>  How are you supplying the parameters and returning them in VS.NET?  If
>>I run





>>from VS.NET, it's fine.

>>SK


>>>Hi Jacco - I am running the SP in the Visual Studio .NET IDE - it
>>>works OK in Query Analyzer. So although there looks like a problem in
>>>the IDE, it can't be the reason I have a bug in my own code :(

>>>Thanks very much for your help.


>>>>How do you output that? I just tested it and this works fine:

>>>>CREATE PROCEDURE Test_p
>>>>(


>>>>)
>>>>AS


>>>>GO




>>>>GO
>>>>DROP PROCEDURE Test_p

>>>>--
>>>>Jacco Schalkwijk
>>>>SQL Server MVP



>>>>>Hi - if I have a SP

>>>>>CREATE PROCEDURE Test
>>>>>(


>>>>>)
>>>>>AS



>>>>>However, if the SP is:

>>>>>CREATE PROCEDURE Test
>>>>>(


>>>>>)
>>>>>AS




>>>>>Many thanks for your help