1

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Madhur Maurya
  • 1,016
  • 4
  • 19
  • 42
  • 1
    try MS SQL Management Studio as ADMINISTRATOR. – Sachu Apr 18 '16 at 11:39
  • 1
    check this [link](http://stackoverflow.com/questions/18286765/sql-server-operating-system-error-5-5access-is-denied) – Sachu Apr 18 '16 at 11:43
  • 2
    Possible duplicate of [CREATE FILE encountered operating system error 5(failed to retrieve text for this error. Reason: 15105)](http://stackoverflow.com/questions/11178536/create-file-encountered-operating-system-error-5failed-to-retrieve-text-for-thi) – MusicLovingIndianGirl Apr 18 '16 at 12:15

0 Answers0