SQL Azure的 - 数据库之间的复制表 [英] SQL Azure - copy table between databases

查看:130
本文介绍了SQL Azure的 - 数据库之间的复制表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行SQL语句:

I am trying to run following SQL:

INSERT INTO Suppliers ( [SupplierID], [CompanyName]) 
Select  [SupplierID], [CompanyName] From [AlexDB]..Suppliers

和得到一个错误参考这个版本的SQL Server不支持数据库和/或服务器名称

and got an error "reference to database and/or server name in is not supported in this version of sql server"

不知道如何在数据库之间复制数据的服务器内部?
我可以加载数据到客户端,然后返回到服务器,但是这是非常慢的。

Any idea how to copy data between databases "inside" the server? I can load data to client and then back to server, but this is very slow.

推荐答案

我知道这是老了,但我有一个一次性运行另一个手动解决方案。

I know this is old, but I had another manual solution for a one off run.

使用SQL Management Studio中R2 SP1连接到蔚蓝,我右键单击源数据库,然后选择生成脚本。

Using SQL Management Studio R2 SP1 to connect to azure, I right click the source database and select generate scripts.

在向导中,我选择了我的表我选择,我要输出到查询窗口后,然后我点击先进。大约一半时的属性窗口
存在用于脚本数据类型的选项。我选择并将其更改为仅数据,然后我完成向导。

during the wizard, after I have selected my tables I select that I want to output to a query window, then I click advanced. About half way down the properties window there is an option for "type of data to script". I select that and change it to "data only", then I finish the wizard.

所有我做的就是检查脚本,重新排列嵌件约束和改变使用在顶部运行它针对我的目标数据库。

All I do then is check the script, rearrange the inserts for constraints, and change the using at the top to run it against my target DB.

然后我右击目标数据库并选择新的查询,该脚本复制到它,并运行它。

Then I right click on the target database and select new query, copy the script into it, and run it.

完成,数据迁移。

希望帮助别人

这篇关于SQL Azure的 - 数据库之间的复制表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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