syntax issue | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

syntax issue

I wanted to find out the total records that my function is using, I wrote: select <functionname>(columnname) from tablename Here functionname is my function,columnname is the column for which I want the data, tablename is the tablename from which I am getting the data I get the error : ‘functionname’ is not a recogonized function. Can someone help me with this syntax. I am a new developer Thanks, StarWarsBigBang

From BOL:
When calling a scalar user-defined function, you must supply at least a two-part name: SELECT *, MyUser.MyScalarFunction()
FROM MyTable Table-valued functions can be called by using a one-part name: SELECT *
FROM MyTableFunction() However, when you call SQL Server built-in functions that return a table, you must add the prefix :: to the name of the function: SELECT * FROM ::fn_helpcollations()
quote:Originally posted by starwarsbigbang I wanted to find out the total records that my function is using, I wrote: select <functionname>(columnname) from tablename Here functionname is my function,columnname is the column for which I want the data, tablename is the tablename from which I am getting the data I get the error : ‘functionname’ is not a recogonized function. Can someone help me with this syntax. I am a new developer Thanks, StarWarsBigBang

Thanks, Name
———
Dilli Grg (1 row(s) affected)
i think you just need to add dbo (or whoever the owner of the function is) before the funtion name: select dbo.<functionname>(columnname) from tablename Ben
quote:Originally posted by starwarsbigbang I wanted to find out the total records that my function is using, I wrote: select <functionname>(columnname) from tablename Here functionname is my function,columnname is the column for which I want the data, tablename is the tablename from which I am getting the data I get the error : ‘functionname’ is not a recogonized function. Can someone help me with this syntax. I am a new developer Thanks, StarWarsBigBang

‘I reject your reality and substitute my own’ – Adam Savage
]]>