最近在研究在數據庫中存儲大數據文件
FileStream 一般在安裝的時候默認是不啟用的
如果在安裝的時候你沒有啟用
EXEC sp_configure filestream_access_level
RECONFIGURE
[sql]
CREATE DATABASE test
ON
( NAME = test_dat
FILENAME =
FILEGROUP testGroup
( NAME = testgroup_dat
FILENAME =
LOG ON
( NAME = Sales_log
FILENAME =
當然你也可以用以下腳本
[sql]
ALTER database test
ADD FILEGROUP FileStreamRecord
CONTAINS FILESTREAM
GO
ALTER database test
ADD FILE
(
NAME=
FILENAME =
)
TO FILEGROUP FileStreamRecord
GO
CREATE TABLE FileStreamRecording
[sql]
(
ID int
RowGuidColumn UNIQUEIDENTIFIER
NOT NULL UNIQUE ROWGUIDCOL
FILESTREAMColumn varbinary(MAX) FILESTREAM
)
[sql]
[sql]
[sql]
INSERT INTO FileStreamRecording VALUES(
INSERT INTO FileStreamRecording VALUES(
INSERT INTO FileStreamRecording VALUES(
GO
SELECT FILESTREAMColumn
具體的使用可參考聯機幫助或在線幫助
From:http://tw.wingwit.com/Article/program/SQLServer/201311/22146.html