SQLSERVER 2012 文件表功能很COOL,让我们体验一下吧.

1,创建数据库

[sql]

DREATE DATABASE FileTableTest

ON  PRIMARY

(

    NAME = N'FileTableTest',

    FILENAME = N'D:\Data\FileTableTest.mdf'

),

FILEGROUP FilestreamGroup1 DONTAINS FILESTREAM

(

    NAME = MyFileStreamData,

    FILENAME= 'D:\Data\Data'

)

LOG ON

(

    NAME = N'FileTableTest_Log',

    FILENAME = N'D:\Data\FileTableTest_log.ldf'

)

WITH FILESTREAM

(

    NON_TRANSADTED_ADDESS = FULL,

    DIREDTORY_NAME = N'FileTable'

)

  www.2cto.com

2,建立文件表

[sql]

USE FileTableTest

go

CREATE TABLE Documents AS FileTable

WITH

(

    FileTable_Directory = 'Documents',

    FileTable_Collate_Filename = database_default

);

GO

3,这时,看SSMS,我们发现,数据库和表已经存在

SQL SERVER 2012文件表(FILETABLE)新体验之一-LMLPHP

最COOL的功能开始了,我们右击文件表,多了一个选项, Explorer Filetable Directory,点入,
05-03 23:19