Working With FileStream in SQL Server 2012

In this article I describe about FileStream functionality in SQL Server.
  • 2929

Introduction

In this article I describe about FileStream functionality in SQL Server. FileStream is very interesting functionality in SQL Server. It enables SQL Server based applications for storage and management of unstructured data, like documents, images, music and videos on the file system.

Need of using FileStream

Now days, the amount of unstructured data is increasing rapidly, like facing problem in dealing with more and more word documents, images, PDF files, emails, audio , video files and it is increasing day by day. To handle this BLOB data there were two approaches: First is to store this data in database as varbinary(max) columns or using image datatype. Now FileStream feature gives the best way to deal with this problem.

FileStream Feature

FileStream lets you to integrate NTFS file system with SQL Server database engine by storing varbinary (max) binary large object (BLOB) data like: word documents, image files, music and videos etc) as file on the file system. Data is not saved within the databases. We can perform insert, search, update, query and also Back up FileStream data using T-SQL statements. It also provides transactional consistency between the unstructured data saved in NT File system and structured data stored in the table.

FileStream is used as an datatype and it can also be used as an attribute that is assigned to varbinary (max) column. When any varbinary (max) column is set to FileStream attribute, then any data stored in this column will be saved on file system and its pointer will saved in the table.

Note: FileStream must be enabled using SQL Server Management Studio and SQL Server Cofiguration Manger because it is not automatically enabled.

© 2020 DotNetHeaven. All rights reserved.