Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating external tables in Azure SQL with different names

I have two existing duplicate databases (say Customers & CustomerPrev) in Azure one of which is newer then the other.

I have another Azure database that I want to query the other two. I've created an external table for the first one but I can't create the external table for the other db as the name already exists.

Can I use different names for external tables? If so, how do I match them up to the actual table?

Thanks

like image 649
ADringer Avatar asked Mar 10 '23 01:03

ADringer


1 Answers

Can you share the exact commands you used to create the external table? However you did it, it should be possible to give the tables different names. From the blog post announcing cross-database queries in SQL Azure:

Several important scenarios require the ability to name your external table differently than the original table on the remote database. Any scenario where a local table already exists with the same name as your remote table are examples of that. All of these scenarios require the ability to use an alias for the remote table name

https://azure.microsoft.com/en-us/blog/querying-remote-databases-in-azure-sql-db/

like image 188
Loren Paulsen Avatar answered Apr 08 '23 02:04

Loren Paulsen