1

Is there a way to import Blob files into sql server 2008 other than using CLR ?

The file size is around 300MB so CLR isn't efficient enough. Is there a possibility to use BULK INSERT or OPENROWSET in 2008 server?

Example in Sql Server 2017 we can do this

CREATE DATABASE SCOPED CREDENTIAL AzureDevBlobImportCred
WITH IDENTITY = 'SHARED ACCESS SIGNATURE',
SECRET = 'st=2018-12-05T.....'

go

CREATE EXTERNAL DATA SOURCE AzureDevBlobImportExternalSrc
WITH  (
    TYPE = BLOB_STORAGE,
    LOCATION = 'https://myStorageAccount.blob.core.windows.net', -- storage account URL
    CREDENTIAL = AzureDevBlobImportCred -- External Data Source
);

then we can use the external data source in bulk import

BULK INSERT #Mytemptable 
FROM 'filename'
WITH (DATA_SOURCE = 'AzureDevBlobImportExternalSrc'
); 

So do we have something like above to import blob files in Sql Server 2008 ?

0

SQL 2008 Does not directly support blob type.

for that you may reuqire to convert block and user XML data type or binary tyle

1) xml = Stores formatted XML documents -> that supports Length/ Size Up to 2GB. OR

2) VARBINARY(max) which Stores up to 2^31–1 bytes of binary data.

I guess varbinary should help you better.

Try which ever suits your need.

0

Use AzCopy, the Azure Storage Explorer, or even the Azure Portal to download the file to somewhere the SQL Server can read it, then use BCP or BULK INSERT to load it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.