Solved

SQL Server 2012 and FileStream Errors

Posted on 2014-03-18
2
654 Views
Last Modified: 2014-03-19
Long story short, for some reason, my FileStream database got corrupted.  We're using it to search Resume documents.  The files in the FileStream Share were being deleted in a Command Window using the DEL command, then XCOPY was used to copy fresh Resume documents from our main File Server each night.  Apparently that's a bad idea because the database ended up hosed and the Log file was 95GB.  I finally got the Log file down to 1GB after setting Recovery Mode to Simple but now I need to fix the errors.

DBCC CHECKTABLE ("RESUMES.dbo.ftbl_resume_files") is reporting the following:
Msg 7908, Level 16, State 1, Line 1
Table error: The file "\de483992-99d3-479a-89ae-b6d15faaaa6f\000078c1-00" in the rowset directory ID a0798d74-a878-4551-9b81-acd807075528 is not a valid FILESTREAM file in container ID 65537.
Msg 7908, Level 16, State 1, Line 1
Table error: The file "\de483992-99d3-479a-89ae-b6d15faaaa6f\New Text Document.txt" in the rowset directory ID a0798d74-a878-4551-9b81-acd807075528 is not a valid FILESTREAM file in container ID 65537.

Open in new window

I used DELETE FROM RESUMES.dbo.ftbl_resume_files to get rid of all document files via SQL but it's still reporting these errors.  I want to basically flush out and reset the FileStream tables back to an empty state so I can copy new Resume Documents back over and create a procedure to properly clear it out each night.  Any ideas would be appreciated.
0
Comment
Question by:wchestnut
2 Comments
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
ID: 39939931
IF and ONLY IF you indeed do not care about data loss then you can try to run a

DBCC CHECKTABLE ("RESUMES.dbo.ftbl_resume_files", REPAIR_ALLOW_DATA_LOSS);  

but make sure nothing is touching that table while DBCC is running

OR...

You can even try to DROP the table and re-create it IF and ONLY IF you do NOT need any of that table data.


Also I suggest use TRUNCATE TABLE instead of DELETE FROM table if you need to get rid of all data in it.
0
 

Author Closing Comment

by:wchestnut
ID: 39940088
Thanks for the idea, lcohan.  No, I don't care about the data so I ran your first option and hit this: The system cannot self repair this error.  I believe this happened because the REPAIR_ALLOW_DATA_LOSS does not work for FileStream tables.

So, I use the Script Table as -> Create to and created a query to drop then re-create the table for future use.  DBCC CHECKDB came out clean.

I will use the TRUNCATE TABLE from now on.  Thanks!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Getting certain data from a string 1 23
Save sql query result in sql server 15 22
Backup Job question 4 19
SQL JOIN 6 31
Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
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 videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now