更新:问题是col1是hiereachyid类型,即使是select也不适用。
嗨,大家好,
我有这个错误-
分布式查询中不允许显示具有clr类型的列的对象。请使用传递查询访问远程对象““remotedb”.“dbo”.“remotetable”。
我已经设置了链接服务器 [RemoteServer.dev.com] .I试图从远程表向当前表执行大容量插入,类似于这样。-
[RemoteServer.dev.com]
INSERT INTO [CurrentDb].[dbo].[Mytable] ( col1, col2 ) SELECT col1,col2 FROM [RemoteServer.dev.com].[RemoteDb].[dbo].[RemoteTable]
有人能帮我吗?谢谢。
如错误所示,由于数据类型的原因,您需要在此处进行传递查询。试试这个:
INSERT INTO [CurrentDb].[dbo].[Mytable] ( col1, col2 ) SELECT col1, col2 FROM OPENQUERY([RemoteServer.dev.com], 'SELECT col1, col2 FROM [RemoteDb].[dbo].[RemoteTable]')