Dynamics AX Knowledge

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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  阅读(569)  评论(0编辑  收藏  举报