Cannot call scalar-valued CLR UDF from select ... from table statement
Posted
by Henrik B
on Stack Overflow
See other posts from Stack Overflow
or by Henrik B
Published on 2009-07-21T14:37:06Z
Indexed on
2010/05/14
2:04 UTC
Read the original article
Hit count: 302
sql-server
|sqlclr
I have created a scalar-valued CLR UDF (user defined function). It takes a timezone id and a datetime and returns the datetime converted to that timezone.
I can call it from a simple select without problems: "select dbo.udfConvert('Romance Standard Time', @datetime)" (@datetime is of course a valid datetime variable)
But if I call it passing in a datetime from a table it fails: "select dbo.udfConvert('Romance Standard Time', StartTime) from sometable" (column StartTime is of course a column of type datetime)
The error message is: "Cannot find either column "dbo" or the user-defined function or aggregate "dbo.udfConvert", or the name is ambiguous."
This message is really for beginners that has misspelled something, but as it works in one case and not in the other, I don't think I have done any misspellings.
Any ideas?
© Stack Overflow or respective owner