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 |
|
allan_houston
Starting Member
18 Posts |
Posted - 2006-07-09 : 08:16:57
|
| Hello everyoneI have a problem with my stored procedure. I'm in learning stage right now so I'm really a freshman. I created a procedure that you can see under this text. My third parameter is an OUTPUT parameter. Yesterday I could execute this procedure like this:exec qAreal 5, 3.5 but today this procedure is complainint and demands the third parameter to be inputed. Why?????create proc qAreal @num1 decimal(10, 2), @num2 decimal(10, 2), @res decimal(10, 2) OUTPUTasdeclare @temp_res decimal(10, 2)select @temp_res = @num1 * @num2--OUTPUTset @res = @temp_res--END SPThx for any help |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-07-09 : 09:45:27
|
| It would always complain about that call.You can either make the parameter optional or add it to the callexec qAreal 5, 3.5, nullorcreate proc qAreal @num1 decimal(10, 2), @num2 decimal(10, 2), @res decimal(10, 2) = null OUTPUTas...you won't get the result though so you shoulddeclare @res decimal(10, 2)exec qAreal 5, 3.5, @res outselect @res==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
allan_houston
Starting Member
18 Posts |
Posted - 2006-07-09 : 10:24:51
|
| Thanks a lot nr. That really made the problem logical. |
 |
|
|
|
|
|
|
|