How to edit the path on a database in SQL 2012

Hi All,

Please see attached. I'm trying to edit the file location of a database path that was set to unc, we need to change it to the local drive of the server.  There is no option to edit the path, tried to take off line. Using SQL Server 2012

Who is Participating?
Kyle AbrahamsConnect With a Mentor Senior .Net DeveloperCommented:
And to change it you would detach it and reattach it as yo_bee suggested.  Just re-attach the MDF using the local drive instead . . . assuming the UNC is the same server.
The data base path is usually set at the DB server level not per DB.
yo_beeConnect With a Mentor Director of Information TechnologyCommented:
You are going to have to:
  1. Detach
  2. Move the MDF and LDF to the new location
  3. Attach

How many databases?
You can scripted it, but it maybe easier to do the steps in the link per DB if it is only a hand full
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

jaya31Author Commented:

The unc path is pointing to the right location however our backups are failing, backup vendor stating because its the unc path. I just need to change it to c:\
Kyle AbrahamsSenior .Net DeveloperCommented:
You can backup to a UNC.  

It's more than likely a permissions issue when writing to the drive that's causing the error.

What account is the sql service running under?

Ensure that account has write permissions to the destination folder.
yo_beeDirector of Information TechnologyCommented:
The path you are looking at is the location of the DB and Logs.  This is not the backup destination.  That setting is in the maintenance plans

Here are some screenshots that will help illustrate this.

jaya31Author Commented:
Thanks all, I detached and re-attached to the local c: and backup is working now. Were using Data Protection Agent to back it didn't like the unc path.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.