Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

README.md

PyAzurite

Very basic implementation of Azure Blob Storage

The purpose of this tool is to allow MSSQL BULK INSERT from an inaccessible drive like \\tsclient.

To use the tool:

  • edit the data_folder path in app.py
  • get a valid certificate (trusted by the computer) for a hostname, edit KEY_PATH and CERT_PATH

n.b. the external storage don't accept uris with a port description, the tool has to run on port 443.

MSSQL Example

--- [Optional] Drop the existing data source
DROP EXTERNAL DATA SOURCE PyAzurite;
GO

--- Add the external data source
CREATE EXTERNAL DATA SOURCE PyAzurite
    WITH (   
        TYPE = BLOB_STORAGE,  
        LOCATION = 'https://FIXME/blob'
    )  
GO

--- Test with CSV
SELECT * FROM OPENROWSET(
   BULK  'test.csv',
   DATA_SOURCE = 'PyAzurite',
   SINGLE_CLOB) AS DataFile;

--- BULK INSERT With data and format file
--- n.b. the documentation mistyped FORMATFILE_DATA_SOURCE
BULK INSERT [mytable]
   FROM 'myfile.tsv'
   WITH
   (
      DATA_SOURCE = 'PyAzurite',
      FORMATFILE_DATA_SOURCE = 'PyAzurite',
      FORMATFILE = 'myformat.fmt',
      DATAFILETYPE = 'widechar',
      CODEPAGE = 'RAW',
      ROWS_PER_BATCH = 1,
      BATCHSIZE = 1000000,
      MAXERRORS = 10000,
      TABLOCK
   );

About

Simple Azure Blob Storage server

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.