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 |
|
Babli
Yak Posting Veteran
53 Posts |
Posted - 2007-01-22 : 03:39:14
|
| I want to declare a varibale inside my function but I am getting an error if I do the following way.CREATE FUNCTION GetString(@inputUrl VARCHAR(300))RETURNS VARCHAR(100)asDeclare @tmp varcharHow should i declare a variable within a function.Thanks in advance,Babli |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-01-22 : 03:41:06
|
[code]CREATE FUNCTION GetString(@inputUrl VARCHAR(300))RETURNS VARCHAR(100)asbegin declare @tmp varchar . . . .end[/code] KH |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-22 : 03:41:29
|
| CREATE FUNCTION GetString(@inputUrl VARCHAR(300))RETURNS VARCHAR(100)asbeginDeclare @tmp varcharreturn @tmpendPeter LarssonHelsingborg, Sweden |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-22 : 03:41:53
|
Peter LarssonHelsingborg, Sweden |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-01-22 : 03:43:53
|
quote: Originally posted by Peso
Peter LarssonHelsingborg, Sweden
i am slightly faster as i did not type in the return @tmp statement KH |
 |
|
|
Babli
Yak Posting Veteran
53 Posts |
Posted - 2007-01-22 : 03:44:18
|
How silly of me to have missed Begin and Endquote: Originally posted by Peso
Peter LarssonHelsingborg, Sweden
|
 |
|
|
|
|
|