0

(I reviewed the comments from this post, but I was not able to resolve my issue).

I am trying to attach a mdf file that I placed in other drive, and I got this error:

enter image description here

I am aware of the permission issue of the folder that I am pointing the file (to attach).

I gave the full control on that folder for both myself and SQL Server account (NT Service\MSSQL$TEST1).

enter image description here enter image description here

I am not sure this extra screenshot would help:

enter image description here

What can I do to fix this?

Java
  • 233
  • 2
  • 8
  • Are you trying to attach with code or via the SSMS UI? – J.D. Mar 17 '23 at 01:21
  • @J.D. SSMS UI only for now. – Java Mar 17 '23 at 04:53
  • 1
    The file path seems strange, if you look a the top image. Are you missing a backslash just before the filename? Try using CREATE DATABASE ... directly (you can script the command from the GUI) and you can now investigate the command, post the command and also the error message (as text, not images). Modifying the original post is preferred instead of adding more details as comments. – Tibor Karaszi Mar 17 '23 at 11:21
  • @TiborKaraszi I realized that when I tried to use other drive (here in this case (E:), it would not get me, but when I put inside C:\ somewhere, it went thru (no issue). How do I add permission on other drive? – Java Mar 17 '23 at 17:30
  • @TiborKaraszi BTW, the E:\ drive is MBR drive, and F:\ drive is GTP drive, and it caused the error when I tried at MBR, but it went thru in GTP. – Java Mar 17 '23 at 17:38
  • run SSMS as admin and see if that works. – SqlDBA Mar 17 '23 at 17:55
  • @SqlDBA Are you asking me to test MBR drive again as Admin, correct? – Java Mar 17 '23 at 17:59
  • @SqlDBA I would like to follow up on previous question. Thanks. – Java Mar 20 '23 at 22:48
  • Check if you have permission on the data file. Open ssms as admin and then try to attach db using data file. – SqlDBA Mar 21 '23 at 23:08

0 Answers0