Solved

SQL Server 2012 and FileStream Errors

Posted on 2014-03-18
2
661 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
I have a large data set and a SSIS package. How can I load this file in multi threading?
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.

920 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

14 Experts available now in Live!

Get 1:1 Help Now