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> Features<strong>The</strong> configuration settings <strong>of</strong> any article that is part <strong>of</strong> a publication can be changed usingthe stored procedures:• for merge replication – sp_changemergearticle• for transactional replication (with or without updatable subscriptions)– sp_changearticle.Both <strong>of</strong> these stored procedures accept the schema_option parameter; this parameteris a bitmap value, where every bit (or "flag") in this parameter represents the status <strong>of</strong> aspecific configuration setting, one <strong>of</strong> which determines whether or not <strong>SQL</strong> <strong>Server</strong> willreplicate the <strong>FILESTREAM</strong> attribute. <strong>The</strong> value returned for this parameter is the bitwiseOR product <strong>of</strong> one or more <strong>of</strong> the values <strong>of</strong> these bits.To replicate a <strong>FILESTREAM</strong> column along with the <strong>FILESTREAM</strong> attribute, the bitrepresented by 0x100000000 should be set; to disable replication <strong>of</strong> the <strong>FILESTREAM</strong>attribute, this bit should be cleared, being careful not to set or clear any bits other thanthe intended one.<strong>The</strong> recommended way to change the <strong>FILESTREAM</strong> replication flag is as follows:• read the existing value <strong>of</strong> the schema_option configuration setting• set or clear the <strong>FILESTREAM</strong> replication flag (0x100000000)• write the modified configuration value back to the publication.Read the current configuration setting<strong>The</strong> first step is to read the current value <strong>of</strong> the schema_option configuration setting,using either the sp_helpmergearticle system stored procedure for merge replicationor sp_helparticle for transactional replication, as shown in Listing 10-3.361

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

Saved successfully!

Ooh no, something went wrong!