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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 User Defined Functions

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-08-15 : 07:00:02
Montesh writes "Hi all, I would like to acess a user defined function without specifying the user name of the creator.

Lets say function name is getNow(@intVar Integer)
i.e. Instead of using Select dbo.getNow(1)
I would like to use it as Select getNow(1)

Please let me know if that is possible"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-08-15 : 07:01:04
From Books Online:
quote:
Calling User-Defined Functions

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()
Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2003-08-15 : 08:25:02
You should make a habit of always using at least the two-part name even for tables and views:

Coding an Owner Prefix to Avoid Recompilation

Jay White
{0}
Go to Top of Page
   

- Advertisement -