Any suggestions? Export (0) Print
Expand All

Create a Table for Storing FILESTREAM Data

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

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 varbinary(max) column and add the FILESTREAM attribute.

To create a table to store FILESTREAM data

  1. In SQL Server Management Studio, click New Query to display the Query Editor.

  2. Copy the Transact-SQL code from the following example into the Query Editor. This Transact-SQL code creates a FILESTREAM-enabled table called Records.

  3. To create the table, click Execute.

The following code example shows how to create a table that is named Records. The Id column is a ROWGUIDCOL column and is required to use FILESTREAM data with Win32 APIs. The SerialNumber column is a UNIQUE INTEGER. The Chart column is a FILESTREAM column and is used to store the Chart in the file system.

Note Note

This example refers to the Archive database that is created in Create a FILESTREAM-Enabled Database.

CREATE TABLE Archive.dbo.Records
	[Id] [uniqueidentifier] ROWGUIDCOL NOT NULL UNIQUE, 
	[SerialNumber] INTEGER UNIQUE,

Community Additions

© 2016 Microsoft