insert into 原始表明([字段名])
select [要复制的表名] from 数据库名.表名
--在当前要接收数据的数据库下执行
Example :
insert into dbo.test([name])
select [name] from MSPetShop4Services.dbo.test_2
select [要复制的表名] from 数据库名.表名
--在当前要接收数据的数据库下执行
Example :
insert into dbo.test([name])
select [name] from MSPetShop4Services.dbo.test_2
SQL数据迁移技巧
本文介绍了一种使用SQL语句进行数据迁移的方法,通过插入到目标表中从源表选择的数据来实现快速有效的数据迁移。这种方法适用于需要在不同数据库之间复制特定字段数据的场景。

被折叠的 条评论
为什么被折叠?



