I am trying to attach a database in SQL Server 2008 and I have .mdf file of database but I am getting an exception of
Attach database failed for Server 'Bilal-PC'. (Microsoft.SqlServer.Smo)
Unable to open the physical file "E:\Intelliscence\Backups\test (2011-07-19)\Database\QBankDB.mdf". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)
I searched the solution of this problem and found one solution of access rights of database file but database file has already full control access rights. Now I want to attach this database or want to get script of this database. But How?
I know this is a duplicate question but all the solutions given in answers are not working for me that's why I am posting this question.
Please help me.
Try to run the Management Studio as Administrator and attach the database.
Right click on Management Studio Properties and Run As Administrator.
Hope it helps you.....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With