Running SQL Server LocalDB 2012 and 2014 on Windows Server 2008 R2 SP1 VM I have some bizarre issues which don't happen when running on Windows 7 or Windows 10.
I can create databases, save data to them, but then after a few minutes the database .mdf
file seems to lock. I get the error (in my c# code)
Failed to update database "dbname" because the database is read-only.
I have ruled out any other application locking the database file. It seems to be an SQL Server issue, so far as I can determine.
I tried opening the database in Management Studio, it tells me the db is read only. It also cannot change the status, throwing a 5 (Access is denied) error (5120)
I can confirm that the database file (mdf) is not write protected - I can rename the file, or open and change it in HxD, for example. If I copy the database files to another computer, it works fine. No permissions or write issues.
SQL can't edit it, and I don't know why. What might be causing this?