error executing OPENROWSET (BULK) / Azure SQL Database

前端 未结 1 810
眼角桃花
眼角桃花 2020-12-22 00:01

I am logged into an Azure SQL Database, using \"Active Directory - Integrated\" authentication wherein I supply my company domain credentials only; no password.

I tr

相关标签:
1条回答
  • 2020-12-22 00:41

    SQLAZURE has no idea of this path..

    C:\Users\username\Downloads\docs_by_day_IncludeDocs.json
    

    you will have to upload the doc to a storage account and try some thing like below

    SELECT *
    FROM OPENROWSET(BULK 'data/product.bcp', DATA_SOURCE = 'MyAzureBlobStorage',
     FORMATFILE='data/product.fmt', FORMATFILE_DATA_SOURCE = 'MyAzureBlobStorage') as data
    

    Prior to that, you will need to create a storage account..

    CREATE EXTERNAL DATA SOURCE MyAzureBlobStorage
     WITH ( TYPE = BLOB_STORAGE,
            LOCATION = 'https://myazureblobstorage.blob.core.windows.net',
            CREDENTIAL= MyAzureBlobStorageCredential);
    

    References:
    https://blogs.msdn.microsoft.com/sqlserverstorageengine/2017/02/23/loading-files-from-azure-blob-storage-into-azure-sql-database/

    0 讨论(0)
提交回复
热议问题