2014-08-29 127 views
2

我們在刪除SQL文件表時遇到問題。每當我跑無法刪除SQL文件表

select * from <MY SQL FILE TABLE> 

我收到此錯誤信息

A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)

當我看到sp_readerrorlog,我看到這條消息

SQL Server internal error. FILESTREAM manager cannot continue with current command.

當我運行此查詢

ALTER DATABASE XXX 
REMOVE FILEGROUP FStream1 

我收到這條消息:

The filegroup 'FStream1' cannot be removed because it is not empty.

我試圖刪除SQL文件表

drop table `SQLFiletable_bck` 

,但我得到這個錯誤:

The FILESTREAM filegroup 'FileStreamGroup1' has no files assigned to it. FILESTREAM data cannot be populated on this filegroup until a file is added.

然後我嘗試這個選項

ALTER TABLE SQLFiletable_bck 
SET (FILESTREAM_ON = "NULL") 

,但我得到這個錯誤

Cannot drop FILESTREAM filegroup or partition scheme since table 'SQLFiletable_bck ' has FILESTREAM columns.

我無法刪除SQL文件表

誰能告訴我什麼辦法強行清理的FileStream和SQL Server 2012中文件組?

回答

0

爲了解決

ALTER TABLE TableName SET (FILESTREAM_ON = "NULL") 

你必須放棄使用FILESTREAM列(S)。爲了能夠做到這一點,您可能不得不放棄一些限制:

ALTER TABLE TableName DROP CONSTRAINT DF_TableName_ColumnName; 
ALTER TABLE TableName DROP COLUMN ColumnName; 
ALTER TABLE TableName SET (filestream_on = "NULL"); 
ALTER DATABASE DatabaseName REMOVE FILE 'DatabaseFileName'); 
ALTER DATABASE DatabaseName REMOVE FILEGROUP "FilegroupName";