如何将数据库表值插入另一个数据库 [英] how to insert database table values into another database

查看:79
本文介绍了如何将数据库表值插入另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Sql server 2005中将数据库表字段值插入另一个数据库

how to insert database table fields values into another database in Sql server 2005

推荐答案

如果数据库位于同一服务器上,则可以执行(给定表结构)确切匹配):

If the databases are on the same server you can do (given the table structures match exactly) :
insert into [dbo.db1.totable] 
select * from [dbo.db2.fromtable]



如果没有,那么创建一个链接服务器然后执行上述操作: http://msdn.microsoft.com/en-us/library/aa213778%28v=sql.80%29.aspx [ ^ ]


这篇关于如何将数据库表值插入另一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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