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 |
|
mary_itohan
Posting Yak Master
191 Posts |
Posted - 2008-09-14 : 08:57:21
|
| create Function [dbo].[User_billing](@user varchar(30))Returns varchar(30)asBegindeclare @priceplan varchar(20), @DefaultCountry int,@return varchar(30)Return ( select @DefaultCountry = DefaultCountry,@priceplan = priceplan from history where username = @user set @return = @DefaultCountry+','+@priceplan return @return)EndI get this errorMsg 156, Level 15, State 1, Procedure User_billing, Line 14Incorrect syntax near the keyword 'set'.Msg 102, Level 15, State 1, Procedure User_billing, Line 17Incorrect syntax near ')'._____________________Yes O ! |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-09-14 : 09:13:24
|
[code]CREATE FUNCTION dbo.fnUserBilling( @User VARCHAR(30))RETURNS VARCHAR(30)ASBEGIN RETURN ( SELECT CAST(DefaultCountry AS VARCHAR(11)) + ',' + PricePlan FROM History WHERE UserName = @User )END[/code] E 12°55'05.63"N 56°04'39.26" |
 |
|
|
mary_itohan
Posting Yak Master
191 Posts |
Posted - 2008-09-14 : 09:37:14
|
| Thank you Peso_____________________Yes O ! |
 |
|
|
|
|
|