January 27, 2011 at 3:10 pm
How do you set a variable to the results of a function call passing one parameter ie
declare @MyVariable varchar(50)
set @MyVariable = MyFunction(@MyParameter)
January 27, 2011 at 3:37 pm
you could try SELECT instead of SET, but I'm curious what error you are getting?
CEWII
January 27, 2011 at 3:58 pm
set @MyVariable = MyFunction(@MyParameter) and
select @MyVariable = MyFunction(@MyParameter) gave the following error:
'MyFunction' is not a recognized built-in function name.
January 27, 2011 at 4:15 pm
L09041975 (1/27/2011)
set @MyVariable = MyFunction(@MyParameter) andselect @MyVariable = MyFunction(@MyParameter) gave the following error:
'MyFunction' is not a recognized built-in function name.
Did you try to call the function including the schema?
E.g. select @MyVariable = dbo.MyFunction(@MyParameter)
January 27, 2011 at 6:34 pm
Thanks that works.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy