17.07.2015 Views

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 10: Integrating <strong>FILESTREAM</strong> with other <strong>SQL</strong> <strong>Server</strong> FeaturesMaximum replication data sizeWhile configuring replication for <strong>FILESTREAM</strong> columns to VARBINARY(MAX) columns,one <strong>of</strong> the most important configuration parameters that needs attention is the maximumreplication data size setting. This is a <strong>SQL</strong> <strong>Server</strong> instance-level configuration which, bydefault, is set to 64 KB.<strong>The</strong>refore, under the default maximum replication data size, and default <strong>FILESTREAM</strong>to VARBINARY(MAX) conversion settings, transactional or merge replication <strong>of</strong> a<strong>FILESTREAM</strong> () column, or any other large-value type, will fail if we attempt to storevalues larger than 64 KB. And not only the replication, but also the INSERT or UPDATEoperation will fail; <strong>SQL</strong> <strong>Server</strong> will abort the INSERT or UPDATE operation and generatethe following error:Length <strong>of</strong> LOB data (nnnn) to be replicated exceeds configured maximum 65536.<strong>The</strong> statement has been terminated.As we have seen several times in the previous chapters, <strong>FILESTREAM</strong> columns are idealonly if the values you expect to store in the <strong>FILESTREAM</strong> column are 1 MB or larger.This obviously means that when you set up transactional replication, you should eitherreplicate to <strong>FILESTREAM</strong>, or change the maximum replication data size configurationsetting so that values larger than 64 KB can be stored and replicated.To change the maximum replication size configuration setting, right-click on the <strong>SQL</strong><strong>Server</strong> instance in SSMS Object Explorer and click Properties, navigate to the Advancedtab and edit the setting, as shown in Figure 10-2.Once the maximum replication data size setting has been increased, you will be able toreplicate <strong>FILESTREAM</strong> data values to VARBINARY(MAX) that are less than, or equal to,the size specified.355

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!