views:

200

answers:

1

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?

+2  A: 

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.

Sean Bright
Good RTFM thanks. Altho this answer will cause massive problems for porting legacy software to MSSQL 2008... I am not impressed
telesphore4
There is not a lot of documentation out there on the "why" part. Sorry this wasn't a satisfactory response.
Sean Bright