Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
radhe
Starting Member
6 Posts |
Posted - 2008-07-11 : 08:08:24
|
hello friend i have supplied input parameters to my program but it is showing error.hereIt must takes i/p parameters and display o/p parameters in query analyser. My code is:
create procedure sp_myproc ( @a int, @b int, @result int output ) as Begin
set @result=@a+@b
End
The o/p can be shown bY:
EXEC 10 20
It is showing error please tell how to see the reuslt of @result in program |
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-07-11 : 08:12:14
|
execute like this...
declare @r int EXEC sp_myproc 10, 20,@r output select @r
Em |
 |
|
radhe
Starting Member
6 Posts |
Posted - 2008-07-11 : 08:18:59
|
quote: Originally posted by elancaster
execute like this...
declare @r int EXEC sp_myproc 10, 20,@r output select @r
Em
Thanks for you fast answer I executed Its working fine.Actually I am learning SP now. |
 |
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-07-11 : 08:21:11
|
might i also suggest then that you don't prefix your stored procedures sp_ 
Em |
 |
|
radhe
Starting Member
6 Posts |
Posted - 2008-07-11 : 08:41:55
|
quote: Originally posted by elancaster
might i also suggest then that you don't prefix your stored procedures sp_ 
Em
Hi elancaster,
could you tell me exactly why sp will be useful and why we declare all variables here they are already in ASP.NET,C#. Why all these O/P param and I/P param. Suggest me any good books. If you are free. Bye |
 |
|
|
|
|