Contents

1 FileStream れ
2 FileTable
3 一危 襦


1 FileStream れ #

File Stream Access襯 谿瑚.
use master
go
exec sp_configure 'filestream access level', 2
go
reconfigure
go

alter database AdventureWorksLT2008
add filegroup [fg_filestream] contains filestream
go

alter database AdventureWorksLT2008
add file
(
	name = 'file_tream_01'
,	filename = 'c:\filestream' 
)
to filegroup [fg_filestream]
go

ALTER DATABASE AdventureWorksLT2008 
SET FILESTREAM
(	
	NON_TRANSACTED_ACCESS = FULL
,	DIRECTORY_NAME = N'File_Dir') 
WITH NO_WAIT 
go

2 FileTable #

use AdventureWorksLT2008;

create table dbo.file_table_sample
as filetable
with 
(
	filetable_directory = 'file_table_sample'
,	filetable_collate_filename = database_default 
)

filetable01.png

3 一危 襦 #

蠏碁殊 豺襯 谿場覲碁.
filetable02.png

螳 ろ語 殊企豌 襦 .
\\localhost\sql2011_ctp3\File_Dir\file_table_sample

蟆暑襦 殊 copy螻 select 企慨覃..
select name, file_stream.GetFileNamespacePath(), is_directory 
from dbo.file_table_sample
filetable03.png

select  FileTableRootPath() + file_stream.GetFileNamespacePath() AS FilePath 
from dbo.file_table_sample
filetable04.png