On one of our Dev DBs I am trying to enable FileStream.
I ran the script below and it is says it went from 0 - Disabled to 2 - Enabled:
Use FileStreamTest
GO
EXEC sp_configure 'filestream access level', 2
GO
RECONFIGURE
GO
But When I run this I get the error FILESTREAM is disabled?:
ALTER DATABASE FileStreamTest
ADD FILEGROUP FS_FG_20110101
CONTAINS FILESTREAM
GO
Running this Shows a value of 2 (Enabled):
SELECT * FROM sys.configurations
WHERE name = 'filestream access level';
Error Message:
Msg 5591, Level 16, State 3, Line 1
FILESTREAM feature is disabled.
Any ideas what I am doing wrong?
EDIT: Do I have to go into the SQL Server Configuration manager and change the properties on the MSSQLSERVER instance (service) as well?
Enabling FILESTREAMRight-click the instance, and then click Properties. In the SQL Server Properties dialog box, click the FILESTREAM tab. Select the Enable FILESTREAM for Transact-SQL access check box. If you want to read and write FILESTREAM data from Windows, click Enable FILESTREAM for file I/O streaming access.
FILESTREAM integrates the SQL Server Database Engine with an NTFS or ReFS file systems by storing varbinary(max) binary large object (BLOB) data as files on the file system. Transact-SQL statements can insert, update, query, search, and back up FILESTREAM data.
FileStream and FileTable are features of SQL Server for storing unstructured data in SQL Server alongside other data. The FileStream feature stores unstructured data in the file system and keeps a pointer of the data in the database, whereas FileTable extends this feature even further allowing non-transactional access.
On SQL Server 2008 R2 it is necessary to restart the SQL server service after the reconfiguration even when you execute RECONFIGURE
or RECONFIGURE WITH OVERRIDE
.
Proof:
SELECT * FROM sys.configurations WHERE name = 'filestream access level';
returns the value for configuration setting 1580 "filestream access level" as 2 but value_in_use 1.
After a restart of the service, the problem goes away and there is one obstacle less on the winding road of FILESTREAM configuration.
Yes, you do need to enable file stream through SQL Server Configuration Manager. Here is some more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With