“ERROR 5123” in MS SQL Server while attaching; i've tried many ways but i haven't get a solution yet
Hello, How are you?
I have a database with 3 tables created by Microsoft SQL Server and I want to "ATTACH" this database. When I use "attach" in
SQL Server I receive the following error:
=============================================
TITLE: Microsoft SQL Server Management Studio
Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&LinkId=20476
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
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\MSSQL12.MSSQLSERVER\MSSQL\DATA\test.mdf'. (Microsoft SQL Server, Error: 5123)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL
%20Server&ProdVer=12.00.4100&EvtSrc=MSSQLServer&EvtID=5123&LinkId=20476
BUTTONS:
OK
================================================
by the way, i tried many ways to solve this problem but my problem haven't solved yet, such as: Changing my SQL Server from 2014 to 2012 Changing my SQL Server type from Enterprise to Developer Switching my operating system from Windows 10 to Windows 8.1 Creating my database and it's tables again Checking my database mdf, log files access type if is Full or not, that were Full.
Aswell, I'm a administrator user. I use the same instance of SQL Server. I'm just work on this database. I connect to SQL Server using "Windows Authentication".
thank a lot for your attention