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 |
|
itnagaraj
Yak Posting Veteran
70 Posts |
Posted - 2011-02-07 : 02:36:46
|
| I am passing one parameter and return single value.But below function throw error.Create FUNCTION [dbo].[UDF_GetTransTypeFormat]( @TranTypeId int)RETURNS @TransFormat VarcharASBEGIN Select Tran_Type_Format into TransFormat From MASTER_TRAN_TYPE Where Tran_Msg_Type='I' And Tran_Type_Id=@TranTypeId return @TransFormatEND For example.i am passing a parameter value=25 it return aaaaaaaawhere i can change it.V.NAGARAJAN |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-02-07 : 02:56:30
|
| do you mean it is returning incorrect value? or any specific error? post the error! |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2011-02-07 : 03:13:40
|
"SELECT INTO" in a function? Yikes.Try thisCREATE FUNCTION dbo.UDF_GetTransTypeFormat( @TranTypeID INT)RETURNS VARCHAR(20)ASBEGIN RETURN ( SELECT Tran_Type_Format From MASTER_TRAN_TYPE Where Tran_Msg_Type = 'I' AND Tran_Type_Id = @TranTypeId )END N 56°04'39.26"E 12°55'05.63" |
 |
|
|
|
|
|