sql server如何建立远程连接?

max20120614 2012-06-15 04:27:05
sql server 如何建立远程连接?比如我本地服务器A数据库aa表aaa,远程服务器B有数据c表d,我希望可以做到在A中做到
select * from B.c.dbo.d insert into aa.aaa
目前对远程服务器B 只有以 windows身份认证的只读权限,没有账号和密码的那种认证方式。

希望会的帮帮忙,谢谢。

主要目的希望可以自动化从B中拉数据到本地,不想手工去导数据了。
...全文
89 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lr1990420 2013-07-09
  • 打赏
  • 举报
回复
那个报错你怎么解决的啊,遇到一样的错了!
max20120614 2012-06-15
  • 打赏
  • 举报
回复
我把那个报错解决了,大神的办法很管用。
max20120614 2012-06-15
  • 打赏
  • 举报
回复

报错了:Msg 15281, Level 16, State 1, Line 1
SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.
max20120614 2012-06-15
  • 打赏
  • 举报
回复
截图不完整啊
迪迦凹凸曼 2012-06-15
  • 打赏
  • 举报
回复
参考

SELECT
*
INTO 表名
FROM OPENDATASOURCE('SQLOLEDB','Data Source=远程服务器B的Ip;Integrated Security=SSPI').[远程数据库名称].[架构].[表名] h

22,210

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧