在romote服务器上调用函数,并用dbo引发错误 [英] calling a function at romote server throwing error with dbo

查看:99
本文介绍了在romote服务器上调用函数,并用dbo引发错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用dbo.function_name调用数据库中的一个函数.它在本地服务器上工作正常,但是当我在服务器上创建它时抛出错误,但是像databasename.function_name一样工作.

但是我想要一个解决方案,因为如果我从dbo更改为服务器名称,则必须在整个数据库中进行更改,请帮帮我

预先感谢

i am calling a function in my database with dbo.function_name. it is working fine at local server but when i created it on server it is throwing error but working like databasename.function_name.

but i want a solution because if i change from dbo to server name i have to change it in my whole database please help me

thanks in advance

推荐答案

好像您已在使用的其他数据库中创建了该函数.您可以:
-在与您使用的数据库相同的数据库中创建函数
-更改与功能所在的数据库的连接
-使用三部分表示法: database.owner.object

Dbo不是服务器名称,而是对象的所有者.您永远不会在查询中定义服务器名称,它是连接字符串的一部分.

如果对象是dbo以外的其他用户拥有的,则应定义所有者.

因此,即使您更改服务器名称(SQL Server实例),SQL语句也不会受到干扰.
Looks like you have created the function in a different database that you''re using. You can:
- create the function in the same database you use
- change the connection to the database where the function is
- use three part notation: database.owner.object

Dbo isn''t the server name, it''s the owner of the object. You never define the server name in your query, it''s part of the connection string.

If the object is owned by another user than dbo you should define the owner.

So even if you change the server name (SQL Server instance) the SQL statements won''t be interfered.


这篇关于在romote服务器上调用函数,并用dbo引发错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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