是否可以将远程MSSQL表中的数据复制到本地表? [英] Is it possible to copy the data in a remote MSSQL table to a local Table?

查看:208
本文介绍了是否可以将远程MSSQL表中的数据复制到本地表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行此操作的最佳方法是什么?我发现了一些INSERT语句,但它们似乎都只能用于内部数据库复制.

What is the best way to go about doing this? I have found some INSERT statements, but they all seem to work just for inner-database copying.

我的演绎:

INSERT INTO [PROGRAM003].[dbo].[faq]
    ([id], [category], [question], [answer], [tags])
SELECT ([id], [category], [question], [answer], [tags])
FROM [SQL2005_552664_gsow].[dbo].[faq]

我对MSSQL的了解还不太流利,因此我们将不胜感激.

I am not very fluent with MSSQL yet, so any and all help is appreciated.

推荐答案

您可以使用 OPENROWSET 来访问其他表服务器.您需要在查询中提供SQL凭据,或者同时设置两个数据库,以允许访问您的Windows ID才能正常工作.您还可以在SQL Server Management Studio中使用导入/导出向导-右键单击数据库,然后选择任务"->导入"或任务"->导出".

You can use OPENDATASOURCE or OPENROWSET to access tables on other servers. You'll need to provide SQL credentials in the query or have both databases setup to allow access to your windows id for this to work. You can also use the import/export wizard in SQL Server Management Studio -- right click on the database and choose Tasks-->Import or Tasks-->Export.

这篇关于是否可以将远程MSSQL表中的数据复制到本地表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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