telesphore4
telesphore4

Reputation: 887

tsql user-defined functions

Is it possible to call a user-defined function in TSQL without the scoping qualifier. I want to call

select myfunc(var)

and not

select dbo.myfunc(var)
select myschema.myfunc(var)

It's possible in every other DB that I've ever worked with (7 others) it has to be possible in tsql too.

If I'm signed into my DB/schema I don't have to qualify a table reference... i can do

select * from mytable

without the qualifier... why aren't function calls orthogonal to this?

Upvotes: 2

Views: 1068

Answers (1)

Sean Bright
Sean Bright

Reputation: 120704

From Executing User-Defined Functions (Database Engine) on MSDN:

...Scalar-valued functions must be invoked by using at least the two-part name of the function...

The writing between the lines here is that the schema name is not required for table-valued UDFs, but I have not personally tested this.

Upvotes: 3

Related Questions