Filestream

The FILESTREAM option is enable by default on all SQL services. Beside the activation in the service configuration, it will be enabled in the DBMS options as well, therefore it will be ready for using on every new system.

Service level configuration

  • Transact-SQL access
  • File I/O access (Windows share name: MSSQLSERVER)
  • Allow remote clients access to FILESTREAM data

Access level instance configuration

Please refer to this Microsoft documentationopen in new window for an overview of FILESTREAM.

For detailed instructions how to use FILESTREAM (create database, tables and accessing data) refer please to this Microsoft documentationopen in new window.

Restriction

Because of the one-way trust between your domain and the resource domain hosting the Managed SQL DBMS, the file upload through bulk operations from a share in customer domain won't work (access denied for sql service account). You will have to use a file share in the resource domain to store the documents to be uploaded in the filestream filegroup.

Please note that this behaviour will apply to direct upload only, for instance using this code example

Use [yourDB]
GO  
INSERT INTO yourTable 
VALUES (NEWID(),'blob'
,(SELECT * FROM OPENROWSET(BULK N'yourpath\filename', SINGLE_BLOB) AS Doc1)
);

Solution: Instead of loading directly the file from share you can alternatively convert it to varbinary:

INSERT INTO yourTable
VALUES (newid (), 'blob',
CAST (''yourpath\filename',' as varbinary(max)));
GO
Last Updated: