when I trying to create simple DB with filestream-Enabled DB with the following Query :
CREATE DATABASE Archive
ON
PRIMARY ( NAME = Arch1,
FILENAME = 'c:\data\archdat1.mdf'),
FILEGROUP FileStreamGroup1 CONTAINS FILESTREAM( NAME = Arch3,
FILENAME = 'c:\data\filestream1')
LOG ON ( NAME = Archlog1,
FILENAME = 'c:\data\archlog1.ldf')
GO
then it’ll have the following error..
Msg 5120, Level 16, State 106, Line 1
Unable to open the physical file "c:\data\filestream1". Operating system error -2147024891: "0x80070005(failed to retrieve text for this error. Reason: 1815)".
I’m sure that every one have full-control permissions on the “c:\data\” directory..
and I’m sure that the File stream is enabled with level 1
also I tried to change the DB files location to the default sql data folder same result..
also I tried to manually create the “c:\data\filestream1” directory
I’ll have the following error :
Msg 5170, Level 16, State 2, Line 1
Cannot create file 'c:\data\filestream1' because it already exists. Change the file path or the file name, and retry the operation.
if anyone have idea how to fix this problem please help me..
thanks in advance
The real answer is as follows:
Ensure that FileStream is enabled. Start/Programs/SQL Server 2008/Configuration Tools/SQL Server Configuration
Right the local Service and go to Properties
Click Tab for FileStream and if not checked, check Enable FileStream for Transact SQL, check Enable FileStream for local Files. Ensure the SQLSERVICE required is specified in the text box
On the LogOn tab ensure that the Service is being started with LOCAL SERVICE
Click OK
Your script should be able to work to create the db. If it fails go to Control Panel/Admin Tools/ Services/
Look for the required SQL Server, verify that the logon is Local Service and the checkbox “Allow this service to interact with desktop” is checked.