How to manage SQL Server FILESTREAM Data
 I want to know how can I create a FILESTREAM enabled database and how to use different DML statements such as INSERT, UPDATE, DELETE and SELECT against a SQL Server 2008 FILESTREAM enabled database?
September 14th, 2015 5:24am

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.

Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 5:55pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics