Solved

Periodic cleaning up for files created by SQL filestream.

Posted on 2011-09-23
3
353 Views
Last Modified: 2012-06-27
I added a filestream column in one of the sql tables.

I am storing word documents into that column - from the web using ASP.net functions.

I am able to store and retrieve the files from the filestream column. My concern is that, every time I add or modify the files, it creates lots of physical files in the associated folder. Is there a best way to periodically cleanup theose files (that were created as part of the filestream).  

I found few methods from my search. But most of them are unclear.

Thanks,

RP
0
Comment
Question by:SasDev
[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 11

Accepted Solution

by:
G_H earned 500 total points
ID: 36587876
Just to be clear, where are these files, and is there a reason for not cleaning them up at the end of "store into DB"?

GH
0
 
LVL 1

Assisted Solution

by:SasDev
SasDev earned 0 total points
ID: 36588899
The files are automatically created by the SQL server.

They are stored on the same folder where the database files are stored (ProgramFiles\MicrosoftSQLServer\MSSQL10.MSSQLSERVER\MSSQL\Data\[specific database name]).

Inside the specific database sub folder, there is one subfolder with the name $FSLOG, a file with the name filestream.hdr and several other subfolders (they are all automatically created as part of the filestream updates).

Regarding cleaning up - that is my main concern. We cannot simply delete these files. We need to check if the are old enough to be deleted. I believe SQL has a command. But I am not clear whether we need to run that command manually. If so, when we need to run?

Thanks,

RP
0
 
LVL 1

Author Closing Comment

by:SasDev
ID: 36935113
Resolved. The SQL server does this automatically and so no action needed by the user unless there are some space issues in the database.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

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