0

I was working on Azure Data Studio. By mistake I created a table in the system administrator's database. I want to transfer it to another database which is created by me. How can I transfer that table?

underscore_d
  • 6,309
  • 3
  • 38
  • 64
  • Use SSMS. https://blog.atwork.at/post/How-to-copy-table-data-between-Azure-SQL-Databases – Jason Pan May 19 '21 at 15:51
  • Or you also can use navicat. https://www.navicat.com/en/products/navicat-for-sqlserver – Jason Pan May 19 '21 at 15:53
  • Hi @Shruti Agrawal, If my answer is helpful for you, please accept it as answer( click on the check mark beside the answer to toggle it from greyed out to filled in.). This can be beneficial to other community members. Thank you. – Leon Yue May 24 '21 at 01:11

1 Answers1

0

With Azure Data Studio, we can't transfer the table to another database directly. Azure SQL database also doesn't support USE statement. And Azure Data Studio doesn't support import or export jobs. The only way are that:

  1. Create the table with data again in user DB again an then delete is in System administration's database
  2. Elastic query(CREATE EXTERNAL DATA SOURCE,EXTERNAL TABLE) to cross database query the table data in System administration's database, and then import it to your user DB.

I tested in Azure Data Studio and it works well. Since you can create table in System administration's database, I think you have enough permission to do this operations.

If you can use SSMS, the could be much easier and there are many ways can achieve it. For example:

  1. Ref the blog: https://blog.atwork.at/post/How-to-copy-table-data-between-Azure-SQL-Databases @Json Pan provide in comment.
  2. Export the table into a csv file and then import to user DB.
  3. You also can use Elastic query.

Just choose the way you like.

Leon Yue
  • 15,693
  • 1
  • 11
  • 23