According to Microsoft Documentation, external tables are now available on Azure SQL Database, having Blob Storage as Data Source.
I was able to create the Master Key, the credential and the Data Source of TYPE = BLOB_STORAGE, as per the script below, and noticed that this version doesn't support file format (Not sure how to handle this as well).
So I tried creating an external table with one single field as VARCHAR(MAX). Therefore I got stuck with this error message:
Mensagem 46525, Nível 16, Estado 31, Linha 32
External tables are not supported with the provided data source type.
This is the script I've been using:
-- Cria uma chave mestra
CREATE MASTER KEY;
go
-- Cria credencial com a chave do Blob fsarquivo2 (essa é a chave)
CREATE DATABASE SCOPED CREDENTIAL AzureStorageCredential
WITH
IDENTITY = 'user',
SECRET = 'Q/rAy00000000000000000000000003Zo4RsxbIb57i2DoJTtU4JYQl1W5FDBIITapphJDRSv4OtniL3Dg=='
;
-- Aqui vc mostra onde fica a fechadura através da URI
CREATE EXTERNAL DATA SOURCE AzureStorage
WITH (
TYPE = BLOB_STORAGE,
LOCATION = 'wasbs://[email protected]',
CREDENTIAL = AzureStorageCredential
);
create external table luiz
(field varchar(MAX))
with
(
DATA_SOURCE = AzureStorage,
LOCATION = 'container0/terrcad.txt'
)
Can anyone help me?