sql 删除FILESTREAM数据

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 删除FILESTREAM数据相关的知识,希望对你有一定的参考价值。

-- Delete row #1
DELETE FROM PhotoAlbum WHERE PhotoId = 1
SELECT * FROM PhotoAlbum

-- Forcing garbage collection won't delete the file without a BACKUP if using FULL recovery model
EXEC sp_filestream_force_garbage_collection 

-- Switch from FULL to SIMPLE recovery model
SELECT name, recovery_model_desc FROM sys.databases WHERE name = 'PhotoLibrary'
ALTER DATABASE PhotoLibrary SET RECOVERY SIMPLE
SELECT name, recovery_model_desc FROM sys.databases WHERE name = 'PhotoLibrary'

-- Forcing garbage collection will now delete the file immediately
EXEC sp_filestream_force_garbage_collection 

以上是关于sql 删除FILESTREAM数据的主要内容,如果未能解决你的问题,请参考以下文章

sql server2008中的FILESTREAM

sql server2008中的FILESTREAM

sql 将FILESTREAM文件组添加到数据库

sql 使用FILESTREAM文件组/容器创建数据库

在SQLServer中启用FileStream

sql 使用FILESTREAM数据重现合并复制中的错误的脚本