Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Cannot create Filestream database

Author  Topic 

patshaw
Posting Yak Master

177 Posts

Posted - 2010-09-29 : 09:51:00
Hi,

I'm using:



Use Master
GO
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'UserImages')
DROP DATABASE UserImages
GO

USE master
GO

CREATE DATABASE [UserImages] ON PRIMARY
( NAME = N'UserImages_Primary', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\UserImages.mdf',
SIZE = 11520KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'UserImages_Log', FILENAME = N'E:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data\UserImages_1.ldf' ,
SIZE = 32448KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO

ALTER DATABASE [UserImages]
ADD FILEGROUP [FileStreamGroup] CONTAINS FILESTREAM
GO

ALTER DATABASE [UserImages]
ADD FILE (NAME = N'UserImages_FileGroup', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\UserImages_2.UserImages')
TO FILEGROUP FileStreamGroup
GO


to create a filestream enabled database and this returns the following error:

Msg 5120, Level 16, State 106, Line 2
Unable to open the physical file "D:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\UserImages_2.UserImages". Operating system error -2147024891: "0x80070005(Access is denied.)".


Does anyone have an idea why I get this error? The database is created but without the filestream filegroup etc. is it permissions related? If so, what permissions need to should be assigned?

Thanks,

Pat.

FWIW, I get the same error whether creating the database from scratch (as above) or when restoring a filestream enabled db from another server.

patshaw
Posting Yak Master

177 Posts

Posted - 2010-09-29 : 11:57:28
This is now resolved. The problem was a permissions error as suspected.
Go to Top of Page
   

- Advertisement -