September 24, 2012

CREATE DATABASE failed


Error:
Message:  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\MSSQL10.MSSQLSERVER\MSSQL\DATA\XYZ.mdf".
Line Number: 2
Source: .Net SqlClient Data Provider
Procedure: 

Error:
Message: CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Line Number: 2
Source: .Net SqlClient Data Provider
Procedure:

Solution:
- Start application with Run as Administrator 
- Change the SQL Server service

No comments: