- Moved by Vincent Chen (X) 13 hours 15 minutes ago
CREATE DATABASE filström ON (NAME = 'filström', FILENAME = 'F:\MSSQL\Catorce\Filström.mdf'),
FILEGROUP filestreamdir CONTAINS FILESTREAM (NAME = 'filströmdir', FILENAME = 'F:\MSSQL\Catorce\filströmdir')
LOG ON (NAME = 'filström_log', FILENAME = 'F:\MSSQL\Catorce\Filström.mlf')
go
USE filström
go
CREATE TABLE hasfilesteam (rowguid uniqueidentifier NOT NULL ROWGUIDCOL,
data varbinary(MAX) FILESTREAM NULL,
PRIMARY KEY (rowguid)
)
Change paths, and add resonable sizes and autogrow values for data and log files.
Once you have the table, you can use INSERT, SELECT etc as usual. However, this is not the benefit. The benefit is if you use the OpenSqlFilstream API and write directly to the columns through the Win32 API. For data files over 1 MB this results in better performance.