且构网

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

将一个数据库导出到另一个数据库

更新时间:2022-05-05 06:31:22

hiiii


Right click on database which you want to export----> tasks--->export data--->next--->select datasource,server name & database name which you want to export --->next--->select Destination where you want to store,server name & database name--->next---->check the option copy data from one or more tables or views---->next--->select all to export database--->check save SSIS package
--->next----> give name --->next--->finish---->close

this is all about export

To import

Right click on database which you want to import----> tasks--->import data--->next--->select datasource,server name & database name which you want to import --->next--->select Destination where you want to store,server name & database namename--->next---->check the option copy data from one or more tables or views---->next--->select all to import database--->check save SSIS package--->next----> give name --->next--->finish---->close


use <DestinationDatabase>
select * into <DestinationTable> from <SourceDataBase>.dbo.<SourceTable>







1 - Right click on the database you want to copy

Choose 'Tasks' > 'Generate scripts'

'Select specific database objects'

Check 'Tables'

Mark 'Save to new query window'

Click 'Advanced'

Set 'Types of data to script' to 'Schema and data'

Next, Next

You can now run the generated query on the new database.

Option 2

Right click on the database you want to copy

'Tasks' > 'Export Data'

Next, Next

Choose the database to copy the tables to

Mark 'Copy data from one or more tables or views'

Choose the tables you want to copy

Finish