将语句从一个服务器插入另一个服务器而不链接服 [英] Insert statement from one server to another without linking server

查看:88
本文介绍了将语句从一个服务器插入另一个服务器而不链接服的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过链接下面提到的服务器来处理两个表之间的插入语句

insert到[servername]。[dbname]。 [tablename或viewname]

从[其他服务器]中选择*。[其他dbname]。[tablename]



当我尝试完成时这给了我错误:验证是否指定了正确的服务器或执行sp-addlinkserver。

因为链接服务器有限制我需要不同的查询来执行insert stsatement。



任何想法欢迎来。



Vijay

I am working on insert statement between two table by linking server mentioned below
insert into [servername].[dbname]. [tablename or viewname]
select * from [other server].[other dbname].[tablename]

when I try to accomplish this it gave me error : Verify if correct server is specified or execute sp-addlinkserver.
since there is restriction on linking server I need different query to execute insert stsatement.

any idea wel come.

Vijay

推荐答案

正确的完整name ins SQL还包含模式名称:

[server]。[db]。 [schema] 。[table]

如果你想使用默认架构,请按如下方式编写:

[server]。[db] .. [table]

(注意双点!)
The proper full name ins SQL contains also schema name:
[server].[db].[schema].[table]
If you want to use default schema write it like this:
[server].[db]..[table]
(Note the double-dot!)


您可以使用OpenRowSet函数:



http://msdn.microsoft.com/en-us /library/ms190312.aspx [ ^ ]
You can use the OpenRowSet function:

http://msdn.microsoft.com/en-us/library/ms190312.aspx[^]


这篇关于将语句从一个服务器插入另一个服务器而不链接服的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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