如何将Storeprocedures一个数据库存储到另一个数据库 [英] How to store the Storeprocedures one database to another database

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

问题描述

我在iam创建项目时维护了两个不同的数据库,但我需要将一个数据库表复制到另一个数据库中。

解决方案

请参阅以下查询

插入 Test1  .dbo.table_T1(名称)
(从测试 .dbo.table_T1中选择名称)



其中Test1和Test是两个数据库并且都有相同的表。

我只是从一个表中获取数据以插入另一个数据库table




所以查询格式如下所示

 插入DatabaseName1.SchemaName .TableName(Column1,Column2)
(从DatabaseName2.SchemaName.TableName中选择Column1,Column2)


用于少量转移两个数据库之间的数据,您可以使用查询。但是如果您需要定期传输大量数据,请使用SSIS包。请查看以下URL以了解有关SSIS包的更多信息。



http:/ /www.mssqltips.com/sqlservertutorial/200/sql-server-integration-services-ssis/ [ ^ ]



对于一次性转移,您可以使用Import /数据库导出功能:)


iam creating project in that iam maintains two different databases but i need to copy one data base table to another..

解决方案

See the below query

insert into Test1.dbo.table_T1(name) 
(select name from Test.dbo.table_T1 ) 


Where Test1 and Test are Two database and both have same table.
I am just fetching data from one table to insert another database table


So format of query is like below

Insert into DatabaseName1.SchemaName.TableName(Column1,Column2)
(Select Column1,Column2 from DatabaseName2.SchemaName.TableName)


For transferring small amount of data between two databases, you can use queries. But if you need to transfer large amount of data periodically then please use SSIS packages. Please check below URL to know more about SSIS packages.

http://www.mssqltips.com/sqlservertutorial/200/sql-server-integration-services-ssis/[^]

For one time transfer, you may use Import/Export feature of database :)


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

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