I have a database file .mdf
from MS SQL EXPRESS in folder:
C:\\Program Files\\Microsoft SQL Server\\MSSQL10.SQLEXPRESS\\MSSQL\\DATA
Giving admin rights or full control to my database install location solved my problem
No need to do all this. Just right click on database files and add permission to everyone. That will work for sure.
I got this error when restoring a database that was backed up on another server. After a long struggle this is what I did
Enabled Instant File Initialization,
Granted permissions (full control) on the folder to the service account and my own windows account,
Restarted the SQL service. Database restored after that.
copy your --.MDF
,--.LDF
files to pate this location For 2008 server C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA 2
.
In sql server 2008 use ATTACH and select same location for add
I was able to solve the problem running MS SQL Management Studio as ADMINISTRATOR.
I was getting similar error.
CREATE FILE encountered operating system error **32**(failed to retrieve text for this error. Reason: 15105) while attempting to open or create the physical file
I used the following command to attach the database:
EXEC sp_attach_single_file_db @dbname = 'SPDB',
@physname = 'D:\SPDB.mdf'