How to change Storage Location for External Tables in Dedicated SQL Pool (Formerly SQL DW)

PS 401 Reputation points
2024-03-23T19:53:00.04+00:00

Hello everyone,

I'm currently in the process of restoring a copy of a dedicated SQL pool (Formerly SQL DW) from server1 to server2 within the same Azure resource group. Following the restoration, I'll need to adjust the storage location in the external tables from Storage1 to Storage2. Both Storage1 and Storage2 have identical folder structures and reside within the same resource group.

Is there a method to efficiently update the location for all external tables in bulk, directing them to the new storage, using PowerShell, and incorporate it into my automation workflow?

Your insights and ideas are greatly appreciated.

Thank you!

Azure SQL Database
Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,373 questions
SQL Server Other
{count} votes

2 answers

Sort by: Most helpful
  1. Azar 29,520 Reputation points MVP Volunteer Moderator
    2024-03-23T20:32:08.2133333+00:00

    Hey there PS

    Thats a good question and thanks for using QandA platform

    First, connect to your Azure environment using PowerShell and query the metadata of your dedicated SQL pool to identify all external tables currently pointing to Storage1.

    For each identified external table, you'll need to update its definition to point to Storage2 instead of Storage1.

    use PowerShell script into your automation workflow. This way, the updates can be executed automatically after the restoration process completes.

    Hope this helps!

    Kindly accept the answer if it helps thanks much.


  2. Nandan Hegde 36,146 Reputation points MVP Volunteer Moderator
    2024-03-27T14:22:22.26+00:00

    Hey,

    The external tables access the storage account via the external data source.

    So you would have to just update the external datasource to the new storage account and credential with the latest stg account value.

    User's image

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.