Azure Synapse - create external table with localtion as column?

Ravi Naganathan 1 Reputation point
2021-11-03T07:11:00.23+00:00

Hello All,

I would like to create external table with file location as column.
Lets say I have stored data per month and per year as folder in data lake.
How can I create "Create External Table" with part of file location as columns?
I am not referring open row set.

Thanks,

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.
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,631 Reputation points Microsoft Employee Moderator
    2021-11-03T17:02:06.747+00:00

    Hi @Ravi Naganathan ,

    Thank you for posting query in Microsoft Q&A Platform.

    We can use filepath() function to get file location. Click here to know about filepath() function.

    Check below image for better understanding.

    146291-image.png

    To know about CETAS(create external table as select) you can check below links

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

Your answer

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