all groups > sql server (alternate) > july 2003 >
You're in the

sql server (alternate)

group:

UDF starting with fn_...


UDF starting with fn_... John P. Marshall
7/31/2003 12:59:45 PM
sql server (alternate):
I've read frequently how stored procedures we create shouldn't be named with
sp_ since SQL Server will first check the master db before the current db
when trying to find the sp to execute. I always nodded and thought how I
was glad I hadn't done that. For some reason it never clicked that UDF
behavior could be the same.

I have several UDFs that start fn_... When I reference a UDF as dbo.fn_...
does SQL Server check the master db for these and only upon not finding them
check the current db? If so, is there a performance hit for this?

TIA,
John


Re: UDF starting with fn_... Erland Sommarskog
7/31/2003 8:39:53 PM
John P. Marshall (jmarshall-nospam@isassoc.com) writes:
[quoted text, click to view]

No. To call a system-supplied UDF, you need to use ::, so that is
what SQL Server looks for. All system-supplied UDFs are table functions,
as scalar system functions are not UDFs at all.


--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
Re: UDF starting with fn_... John P. Marshall
8/1/2003 12:41:50 AM
Erland,

Cool... thanks for the good news.

Regards,
John

[quoted text, click to view]

AddThis Social Bookmark Button