Create a Table
This topic shows how to create a table for storing FILESTREAM data. When the database has a FILESTREAM filegroup, you can create or modify tables to s
This topic shows how to create a table for storing FILESTREAM data.
When the database has a FILESTREAM filegroup, you can create or modify tables to store
FILESTREAM data. To specify that a column contains FILESTREAM data, you create a
column and add the FILESTREAM attribute.
- In SQL Server Management Studio, click
to display the Query Editor.
- Copy the Transact-SQL code from the following example into the Query Editor. This
Transact-SQL code creates a FILESTREAM-enabled table called Records.
- To create the table, click.
The following code example shows how to create a table that is named. The
column is a
column and is required to use FILESTREAM data with Win32 APIs. The
column is a. The
column is a
column and is
used to store the
in the file system.
7
Note
This example refers to the Archive database that is created in.
Records
Id
ROWGUIDCOL
SerialNumber
UNIQUE INTEGER
Chart
FILESTREAM
Chart
CREATE
TABLE
Archive.dbo.Records (
[
Id
] [uniqueidentifier] ROWGUIDCOL
NOT
NULL
UNIQUE
,
[SerialNumber]
INTEGER
UNIQUE
,
[Chart] VARBINARY(
MAX
) FILESTREAM
NULL
);
GO