1

I have encountered with a problem. I was serfing the google how to change the mdf file location and found this post: How do I move SQL Server database files?. But as it usually happens I did an error. I have used this code:

USE master;
ALTER DATABASE foo
MODIFY FILE (name='DB_Data1', filename='X:\NewDBFile\DB_Data1.mdf');

and modified DB_Data1.mdf to DB_Data1_log.mdf. And now I can't attach this database to sql studio or open it in Visual Studio. enter image description here I need help please!

Drug
  • 11
  • 1
  • If you have logon permissions to the server, you have more options, like going to the D drive and changing the name back. Do you have server access? – James Jenkins Nov 06 '17 at 18:59
  • That's the problem. I don't. – Drug Nov 06 '17 at 19:37
  • I have solved this problem by giving to user "Anyone" full access to the .mdf file in Security properties in Windows Explorer. As I expected security policy depends on some special user access rights. But I didn't find which system user profile could give such rights. – Drug Nov 07 '17 at 15:20

0 Answers0