Cannot attach database access denied

I regularly have issues attaching public databases on my VMs resulting in the above error.

There can be a few reasons for it. Firstly might be because your service account doesn’t have permissions set on the location your data file has been placed. If it’s in a new folder, you need to grant your service account permissions to it. If it’s in your normal data file location it potentially isn’t inheriting permissions from the folder which can arise if you unzip directly into the data file location.

So what happens if you’re still getting these issues? I was tearing my hair out one day with this. I knew the permissions were ok. I even ripped it all out and started again. Still not joy. Running SSMS as administrator fixed it!

Share this post...

Leave a Reply

Your email address will not be published. Required fields are marked *