链接服务器的问题 [英] problem with linked server
问题描述
我正在尝试从本地执行以下命令以截断生产中的表格
truncate table server1.udupikrishna.dbo.emp1 < br $> b $ b
但它会抛出:消息4701,等级16,状态1,行1找不到对象emp1因为它不存在或者你没有权限。 server1是我的链接服务器。
server1是我在本地环境中设置的链接服务器。
我们不能在链接服务器上执行删除操作。
如果是permisiion问题那么我可以从哪里来设置链接服务器的修改权限?
问题2
i am trying to execute following command from local to truncate table on production
truncate table server1.udupikrishna.dbo.emp1
but it throws :Msg 4701, Level 16, State 1, Line 1 Cannot find the object "emp1" because it does not exist or you do not have permissions. server1 is my linked server.
server1 is my linked server i have setup in local environment.
cant we perform delete operation on linked server.
if it is permisiion issue then from where i can set modification permission to link server ?
ISSUE 2
declare @NumRow int= 0
select @NumRow = count(id) from emp
BEGIN TRAN t1
insert into server1.udupikrishna.dbo.emp1 (name) select name from emp
IF (@@ROWCOUNT = @NumRow AND @@ROWCOUNT > 0 )
BEGIN
COMMIT TRAN t1
print 'Inserting Records..'
delete from emp
END
ELSE
BEGIN
print 'There are not any record to insert..'
ROLLBACK TRAN t1
END
以上查询返回错误:
OLE DB提供程序SQLNCLI 11用于链接服务器server1返回消息伙伴事务管理器已禁用其对远程/网络事务的支持。。
消息7391,级别16,状态2,行4
无法执行操作,因为链接服务器server1的OLE DB提供程序SQLNCLI11无法开始分布式事务。
Above query return error:
OLE DB provider "SQLNCLI11" for linked server "server1" returned message "The partner transaction manager has disabled its support for remote/network transactions.".
Msg 7391, Level 16, State 2, Line 4
The operation could not be performed because OLE DB provider "SQLNCLI11" for linked server "server1" was unable to begin a distributed transaction.
推荐答案
所有,你需要解决权限问题...正如我之前写的,阅读这些文章:
http://msdn.microsoft.com/en-us/library/ms175537%28v=sql.105%29.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/ms188279.aspx [ ^ ]
http:/ /msdn.microsoft.com/en-us/library/aa560998.aspx [ ^ ]
http: //msdn.microsoft.com/en-us/library/ms190479.aspx [ ^ ]
First of all, you need to solve problem with permissions... As i wrote before, read these articles:
http://msdn.microsoft.com/en-us/library/ms175537%28v=sql.105%29.aspx[^]
http://msdn.microsoft.com/en-us/library/ms188279.aspx[^]
http://msdn.microsoft.com/en-us/library/aa560998.aspx[^]
http://msdn.microsoft.com/en-us/library/ms190479.aspx[^]
Maciej los''链接非常实用。
你也可以尝试这个:合作伙伴事务管理器已禁用其对远程/网络事务的支持,这可能会引导您获得大量相关事实。
Maciej los'' links are quite useful.
You can also try this one : The partner transaction manager has disabled its support for remote/network transactions, which will likely lead you to plenty of relevant facts.
这篇关于链接服务器的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!