Avatar of jackjohnson44
jackjohnson44
 asked on

sql server moved database files now it says recovery pending

I moved my database files from my C drive to my J drive, then ran this code to move the database locations.  It appeared to work, but my databases all say "Recovery Pending".  If I try to open one, I get an error that says The database HOD200301 is not accessible. (ObjectExplorer).

How can I fix this?

ALTER DATABASE  HOD200203 MODIFY FILE (NAME = HOD200203 , FILENAME = 'J:\OptionDB\HOD200203.mdf ');
ALTER DATABASE  HOD200203 MODIFY FILE (NAME = HOD200203_log , FILENAME = 'J:\OptionDB\HOD200203_log.ldf ');
Microsoft SQL Server 2008Microsoft SQL Server

Avatar of undefined
Last Comment
jackjohnson44

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
sognoct

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
jackjohnson44

ASKER
I am actually detaching them all now then I am going to recreate, like you said.  Thanks!
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy