Home > database >  How to copy SQL .mdf file in windows
How to copy SQL .mdf file in windows

Time:01-20

For my school project I need to send .mdf file to my teacher. I'm trying to copy .mdf file of my database witch is saved in "C:\Program Files\Microsoft SQL Server\MSSQL15.SQL2019\MSSQL\DATA" folder. But windows doesn't let me do that. It gives me an error

Open Error: Access id denied.

enter image description here

I tried to change folder permissions but it didn't works. I don't want backup file or script file, because my teacher said to send .mdf file. Is there any way to copy that?

CodePudding user response:

Option1: Stop the Database services and copy it Option2: Detach the database

CodePudding user response:

Since it was restricted by windows, I made a bootable flash drive with linux and run it on startup and use it to copy mdf file. It seems to be the only way which works for me.

  •  Tags:  
  • Related