1

Sorry if this question does not make sense, I have no experience with databases, I just stumbled upon this task.

I need to attach an mdf to a database. I have the mdf file stored in my local computer. When I click attach in SSMS, and then add, I can only browse the disks and folders of the SQL Server, while the file is in my local computer. How can I move the mdf file to the sql server?

2
  • 1
    Can you remote into the SQL Server computer? Sep 12, 2019 at 15:05
  • ...or get to an exposed folder on it via UNC, or get to a network path that the server can also see. I'd also wonder why you have an MDF file as a backup and not a, well, backup, Sep 12, 2019 at 15:44

1 Answer 1

1

As Aaron Bertrand says in the comments, having a .mdf file as the method for adding a database to a server is unusual. Normally you should have a .bak backup file. If at all possible, contact your source and ask for backup to restore.

If you have to use an .mdf You need to copy it to the folder on the server, where it will become the .mdf of the database when it is live. Normally you would do this with an RDP or share connection to the folder. Be aware there are several issue you may encounter doing this.

See these related posts for the answer to questions you have not asked yet, but probably will.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.