I am getting following error while trying to create a snapshot in SQL Server 2012. I am writing the query below:
CREATE DATABASE B2BSnapshot
ON (NAME = 'B2B',
FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data' ) AS SNAPSHOT OF B2B;
GO
Error:
Msg 1823, Level 16, State 2, Line 4
A database snapshot cannot be created because it failed to start.Msg 5123, Level 16, State 1, Line 4
CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data'.
I tried with both Windows and SQL server authentication. I also tried with different folders in each drive, gave full permission to user listed in "logon" section of SQL Server configuration manager but I am unable to get rid of this problem. Please provide with more inputs.