SQL server 2008 formally called Katmai aims at Data management, Self orgnaizing and self maintaining capabilities. Microsoft aims at high availability (towards zero downtime availability). It supports for structured and unstructured data. Structured data is nothing but your table or any other formatted one where as unstructured data includes file streams and video images.
SQL Server 2008 allows us to store XML, emails, files and spatial information. FileStream is a new datatype introduced in Katmai, its used to stored the data in the file system.
Details about the file like file type, file size, file name will be considered as structured data and its stored in the sql server database whereas the contents of the file is considered as an unstructured data and gets stored in the file system. The contents can be accessed either by Win32 API or by using T-SQL statements.
Steps to be followed in implementing File Stream Data type:
1. First, we have to configure the file stream property.
Belows is the syntax to configure the file stream property,
Code Snippet |
sp_filestream_configure [ [ @enable_level = ] level ] [ [ , @share_name = ] 'share_name' ] |
The enable level should have a value from 0 to 3 indicating the authorization level like whether T-SQL access is allowed or not, Win32 API is required or not etc..,
2. Once executing the above command just check it out in the command prompt using the command NET SHARE.
3. The primary requirement to implement file stream property is to create the database with atleast one filegroup contains filestream property.
4. Create the table with column type as filestream. Unique constraint will be enforced on the table which has filestream type.
5. Insert the data into file stream datatype column and it gets stored in the file system.
Please provide me your valuable feedback. I will post the exact code in my next postings.
Regards,
Venkatesan Prabu .J