是否可以在没有架构名称的情况下调用用户定义的函数? [英] Is it possible to call a user-defined function without the schema name?

查看:39
本文介绍了是否可以在没有架构名称的情况下调用用户定义的函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 MS SQL 2005,当我创建一个函数时,我需要输入架构名称来调用它:

I'm using MS SQL 2005 and when I create a function I need to put the schema name to call it:

select dbo.MyFunc

我的所有表也都在dbo"架构中,我不需要架构名称来引用它,所以我想知道我是否缺少一些可以对功能执行相同操作的配置.

All my tables are also in "dbo" schema and I don't need the schema name to reference it, so I'd like to know if I'm missing some configuration that could do the same to functions.

推荐答案

简而言之,不是.

您应该考虑使用架构所有者作为所有数据库对象的前缀,以避免让sql server查找".

You should consider to prefix all your database objects with the schema owner to avoid having sql server to "look it up".

它使您的语句更具可读性,并略微提高了性能(尽管您可能不会注意到这一点).

It makes your statements more readable and gives a slight increase in performance (although you'd probably won't notice it).

问候,利文

这篇关于是否可以在没有架构名称的情况下调用用户定义的函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆