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 |
|
chih
Posting Yak Master
154 Posts |
Posted - 2008-04-10 : 22:25:26
|
| Hi Everyone,here is a simple SPCreate procedure test @input floatasBeginreturn @inputENdIf I execute the followingdeclare @output floatexec @output=test 1.12121select @outputwhy I got 1 not 1.12121?any idea? How to get the correct result?Thank you in advance |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-04-10 : 22:40:48
|
| Because RETURN only returns integers. You must use an output variable instead.Create procedure test (@input float, @output float OUTPUT)asBeginSET @output = @inputENdgodeclare @output floatexec test @input = 1.12121, @output = @output OUTPUTselect @outputdrop proc testTara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
chih
Posting Yak Master
154 Posts |
Posted - 2008-04-11 : 02:24:04
|
Thank youquote: Originally posted by tkizer Because RETURN only returns integers. You must use an output variable instead.Create procedure test (@input float, @output float OUTPUT)asBeginSET @output = @inputENdgodeclare @output floatexec test @input = 1.12121, @output = @output OUTPUTselect @outputdrop proc testTara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/
|
 |
|
|
|
|
|