While trying to attach a filestream database in SQL 2005 – onto a mounted drive, I received the following errors and the database would not attach.
“Could not open file ‘mounted drive:\foldername\filestream folders’ for file number 65540. OS error: 0xc0000022(failed to retrieve text for this error. Reason: 15105).”
- Check that you do not have the data or log files in the root of the mounted drive. In my example I mounted the drive as “M:\DATA”, so I created a subfolder and applied permissions on this subfolder – “M:\DATA\datafiles”.
- Check that the SQL Service account “SQLServerMSSQLUser$servername$SQLinstancename” has full permissions on the folder and that the permissions are passed onto the files and folders located within this folder.
- Once you have ensured that the two setting above are in place you should have no problem attaching the filestream database.
Please refer to another article I wrote on how to Attach FILESTREAM-Enabled Database with multiple data files and filestream directories