Solved

Filestream index randomly changing filegroup

Posted on 2014-01-23
3
401 Views
Last Modified: 2014-01-24
I have a table with a filestream column holding about 2000 photographs. When I created it I set the primary key to the unique identifier column (probably an unnecessary step). I checked table properties and it was assigned to the filestream filegroup. Everything OK for a couple of weeks, repopulating the table many times without incident. Just now I have discovered that the index has moved itself from the filestream filegroup to the default secondary (user data) filegroup. After repopulating the table I got the message:

Could not allocate space for object 'dbo.T_AllPhotos' in database 'myDB' because the 'FG_UserData' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

By way of confirmation I checked the table's filegroup in table properties and queried sys.filegroups/sys.indexes, and it has indeed moved. I've now dropped the primary key on this table (there are no other indexes), but am still stuck with this table being in the wrong filegroup. The only thing that changed recently was that I added a new varchar column to the table, not indexed. Can this really be responsible for filegroup changing?
0
Comment
Question by:TimHudspith
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Expert Comment

by:x-men
ID: 39803141
create a clustered index on the filestream filegroup.
0
 

Author Comment

by:TimHudspith
ID: 39805601
Can you guide me on the synatax? The following gives me the error 'invalid filegroup specified'.

CREATE UNIQUE CLUSTERED INDEX ux_AllPhotos_Filename
ON dbo.T_AllPhotos(Filename)
ON [FG_Filestream]

Open in new window

0
 
LVL 18

Accepted Solution

by:
x-men earned 500 total points
ID: 39805985
for table :
                                           
CREATE TABLE dbo.T_AllPhotos
      (
      EmployeeId int
      ,[filename] varbinary(max) FILESTREAM NULL
      ,MyRowGuidColumn uniqueidentifier NOT NULL ROWGUIDCOL
          UNIQUE DEFAULT NEWID()
      );



CREATE UNIQUE CLUSTERED INDEX [ClusteredIndex-20140124-094404] ON [dbo].[T_AllPhotos]
(
      [EmployeeId] ASC
) FILESTREAM_ON [FG_Filestream]
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question