FILESTREAM -- SQL Server2008 New Feature

In SQL2008, it made a new feature named FILESTREAM.

The FILESTREAM feature allows you to associate fi les with a database. The fi les are stored
in a folder on the operating system, but are linked directly into a database where the fi les can
be backed up, restored, full-text-indexed, and combined with other structured data.

The FILENAME property defi ned for a FILESTREAM
fi legroup specifi es the path to a folder. The initial part of the folder path defi nition must exist;
however, the last folder in the path defi ned cannot exist and is created automatically. After
the FILESTREAM folder has been created, a fi lestream.hdr fi le is created in the folder, which is
a system fi le used to manage the fi les subsequently written to the folder

1, The path should be existed in Windows OS.

2, Enable FILESTREAM for Transact-SQL access  on SQL Server Configuration Manager ->SQL server service: Properties

(If you want to read and write FILESTREAM data from Windows, click Enable FILESTREAM for file I/O streaming access. Enter the name of the Windows share in the Windows Share Name box.

If remote clients must access the FILESTREAM data that is stored on this share, select Allow remote clients to have streaming access to FILESTREAM data.)

3, Execute below code:

EXEC sp_configure filestream_access_level, 2

RECONFIGURE

Now you can use FILESTREAM feature. The below is a example on creating a new DB from MS Kit.

CREATE DATABASE TK432 ON PRIMARY
( NAME = N'TK432_Data', FILENAME = N'c:\test\TK432.mdf' ,
SIZE = 8MB , MAXSIZE = UNLIMITED, FILEGROWTH = 16MB ),
FILEGROUP FG1
( NAME = N'TK432_Data2', FILENAME = N'c:\test\TK432.ndf' ,
SIZE = 8MB , MAXSIZE = UNLIMITED, FILEGROWTH = 16MB ),

FILEGROUP Documents CONTAINS FILESTREAM DEFAULT
( NAME = N'Documents', FILENAME = N'c:\test\TK432Documents' )
LOG ON
( NAME = N'TK432_Log', FILENAME = N'c:\test\TK432.ldf' ,
SIZE = 8MB , MAXSIZE = 2048GB , FILEGROWTH = 16MB )
GO

 

posted on 2010-12-15 16:41 Jacky Xu 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/JackyXu1981/archive/2010/12/15/FILESTREAM-SQL2008.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值