locked
Can't bulk insert remote csv file into azure mssql dB, Show error, file can't be opened / inaccessible error RRS feed

  • Question

  • Hi,

    I have try to import csv file which is located in remote server to azure mssql db table . But it is showing error: 

    Cannot bulk load because the file "\\remoteIp\drive:\path\filename.csv" could not be opened. Operating system error code (null). 

    I learned that it would be possible, once if we get the csv file to azure MSSQL External Resource through azure file storage. from there we can read the file directly. If this method is possible, is there any way I can upload the CSV file to azure storage programmatically(using API call uploading dynamically csv file).

    is there any solution for this issue, kindly help


    • Edited by SujinSNair Friday, December 14, 2018 12:39 PM
    • Moved by angoyal-msft Friday, February 22, 2019 4:21 AM
    Friday, December 14, 2018 12:29 PM

All replies

  • Hi SujinSNair,

    Have you looked here? https://github.com/Microsoft/sql-server-samples/tree/master/samples/features/sql-bulk-load/load-from-azure-blob-storage

    There are a few examples how to do this through Azure Blob Storage.

    Thanks.

    James

    Friday, December 14, 2018 9:58 PM
  • CREATE EXTERNAL DATA SOURCE MyAzureBlobStorage
    WITH ( TYPE = BLOB_STORAGE, 
    LOCATION = 'https://sqlchoice.blob.core.windows.net/sqlchoice/samples/load-from-azure-blob-storage', 
    -- CREDENTIAL= MyAzureBlobStorageCredential --> CREDENTIAL is not required if a blob storage is public!
    );

    I have these questions

    blob storage the storage associated with the azure. So can't access external server. 

    the file is dynamic, need to run it programmatically so if I can't access my server, it's there any way (API) to put the file to azure storage.

    Thank You


    Sujin

    Sunday, December 16, 2018 2:21 PM