0

I am trying to get access to my Azure blob storage via SQL. This (https://learn.microsoft.com/en-us/sql/t-sql/statements/create-external-table-transact-sql) article describes how it works.

I have tried the following SQL command:

-- PolyBase only: Azure Storage Blob as data source   
-- (on SQL Server 2016 and Azure SQL Data Warehouse)  
CREATE EXTERNAL DATA SOURCE dataSourceNameTestBlob  
    WITH (   
        TYPE = HADOOP,  
        LOCATION = 'wasb[s]://container@account_name.blob.core.windows.net'
        [, CREDENTIAL = credential_name ]
    )  
[;]

Which results in the following error:

Msg 102, Level 15, State 1, Line 5 Incorrect syntax near 'HADOOP'.

When I google on this error I find that I need to use sql DW (.dsql) instead of .sql queries. However the article mentions that I can use a Azure SQL Database.

What am I doing wrong? I just only want to access my blob storage in SQL.

0

1 Answer 1

1

PolyBase scenario with Hadoop is only supported on SQL Server 2016 (or higher), Azure SQL Data Warehouse, and Parallel Data Warehouse.

Below is the T-SQL script against Azure SQL Database to store to blob storage.

CREATE EXTERNAL DATA SOURCE data_source_name  
    WITH (   
        TYPE = BLOB_STORAGE,  
        LOCATION = 'https://storage_account_name.blob.core.windows.net/container_name'
        [, CREDENTIAL = credential_name ]
    )  
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.