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 7: <strong>FILESTREAM</strong> Database Administration<strong>The</strong> scripting process does not require any <strong>FILESTREAM</strong>-specific changes; it is the sameas the process for a non-<strong>FILESTREAM</strong> database. SSMS generates INSERT statementsto populate the target database with the same values as the source table, including the<strong>FILESTREAM</strong> columns. <strong>FILESTREAM</strong> columns are exported as a hex string, as shown inListing 7-37.INSERT [dbo].[Items] ([ItemID],[ItemNumber],[ItemDescription],[ItemImage])VALUES (N'f326ed65-5131-4ef7-891a-89fad516b856',N'MS1001', N'Micros<strong>of</strong>t Mouse',0xFFD8FFE000104A46494600010100000100010000FFDB004300090607080706090807080A0A090B0D160F0D0C0C0D1B14151016201D2222201D1F1F2428342C242631271F1F2D3D2D335373A3A3A232B3F443F384334393A37FFDB0043010A0A0A0.................................................3737373737373737373737FFC00011080067007A030122000)Listing 7-37:INSERT statement for a <strong>FILESTREAM</strong> column.<strong>The</strong> Scripting Wizard allows us to generate scripts to be deployed on a different version<strong>of</strong> <strong>SQL</strong> <strong>Server</strong>. This is one <strong>of</strong> the areas where the scripting functionality adds value overregular backups, as we cannot, for example, restore a <strong>SQL</strong> <strong>Server</strong> 2008 R2 backup on<strong>SQL</strong> <strong>Server</strong> 2008.We select the target database in the Advanced Scripting Options screen (Figure 7-3).307

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

Saved successfully!

Ooh no, something went wrong!