Solved

Filestream index randomly changing filegroup

Posted on 2014-01-23
3
394 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Display SQL maintenance plan SQL Code 3 47
SQL Query (lookup) 8 65
Search Text in Views 2 28
Need SQL Query improved for multiple column joins 2 8
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

739 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