[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

Periodic cleaning up for files created by SQL filestream.

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
SasDev
Asked:
SasDev
  • 2
2 Solutions
 
G_HCommented:
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
 
SasDevAuthor Commented:
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
 
SasDevAuthor Commented:
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

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now