且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将数据库表值插入另一个数据库

更新时间:2023-02-07 08:48:35

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

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 [ ^ ]