我有一张桌子(称之为A_table
)在数据库中(称之为A_db
)在 Microsoft SQL Server Management Studio 中,有 10 行。
我有另一个数据库(称之为B_db
),并且它有一个表(称之为B_table
),其列设置与A_table
有。但是B_table
是空的。
我想要的是:
-
Copy每一行从
A_table
to B_table
.
有没有什么选择微软 SQL Server 管理工作室 2012,从表创建插入 SQL?或者还有其他选择可以做到这一点吗?
快速简便的方法:
- 右键单击数据库
- 指向
tasks
In SSMS 2017 you need to ignore step 2 - the generate scripts options is at the top level of the context menu
谢谢Daniel https://stackoverflow.com/users/5740181/daniel-elkington以便评论更新。
- Select
generate scripts
- 点击下一步
- 选择桌子
- 点击下一步
- 单击高级
- 滚动到
Types of data to script
- 被称为types of data to script
在 SSMS 2014 感谢埃勒塞迪尔 https://stackoverflow.com/users/1861513/ellesedil用于评论
- Select
data only
- 单击“确定”关闭高级脚本选项窗口
- 单击下一步并生成脚本
我通常在这种情况下生成一个新的查询编辑器窗口,然后在需要时进行任何修改。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)