简体   繁体   中英

How to copy tables from a database into another database in SQL Azure?

We made two backups from a database that needed changes in many tables, one is an exact copy of that database and the other is a BACPAC file.

The new model for the database is ready but I was wondering, how can I copy the contents of the tables we want to recover from the copy of the original database? Is it possible?

I tried using SQL Server Management Studio 2012 but I couldn't find an option that could let me copy from a BACPAC file which is weird because everywhere I look into people is saying that by right click on the name of the database on the Tasks submenu there should be an Import option but there's not such option in it.

Can I copy the contents of a table into another table from a different database? Or is there a way to import the data from the BACPAC file into our modified database?

Did you try the following?

Insert into dbA.user.table (a,b,c)
Select a,b,c from dbB.user.table

OR

  SELECT a,b,c 
  INTO dbA.user.table
  FROM dbB.user.table

In SQL Server Management Studio (version 2012 or later), right click on the "Databases" node (not on your database) and choose "Import Data-tier Application" to restore a BACPAC file (or choose "Deploy Data-tier Application" to restore a DACPAC file).

右键单击SSMS中的“数据库”节点

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM