February 5, 2009 at 2:42 am
Dear All,
When I execute the following query for changing the file path of a database file am getting error.
Use Master
Go
Alter database TEST_FILE
Modify file(name=TEST_FILE, filename='D:\test')
ERROR is
"MODIFY FILE failed. Do not specify physical name."
What could be the problem..? Pls help.
SwmSan
February 5, 2009 at 3:07 am
Actualy I DONT WANT to change the filenames.
I want to change the location of my MDF & LDF files....
(in someother folder.....)
February 5, 2009 at 3:09 am
Use Master
Go
Alter database TEST_FILE
Modify file(name=TEST_FILE, filename='D:\test')
You should specify the full path:
Use Master
Go
Alter database TEST_FILE modify file(name='TEST_FILE', filename='D:\test.mdf')
Alter database TEST_FILE
modify file(name='TEST_FILE_log' filename='D:\test_log.mdf')
Once done check the changed path using:
SELECT * From sys.sysfiles
February 10, 2009 at 2:25 am
Hi,
I did it that way.. this time it worked and showed the new file path properly. But when I restarted the SQL server I got the following error.
"Database DB_NAME' cannot be opened due to inaccessible files or insufficient memory or disk space.
See the SQL Server errorlog for details. "
Why this error.?
February 10, 2009 at 3:06 am
"Database DB_NAME' cannot be opened due to inaccessible files or insufficient memory or disk space.
See the SQL Server errorlog for details. "
Is there enough space in D:\ drive then?
Did you see the error log for details then? You should be able to see the reason. Post the log file if you are not able to analyze it. We would be able to help you out further
February 10, 2009 at 3:31 am
There is enough space in D:\. I will check the log and revert back.By the way, am doing it in sql express...does it make any diff..?
February 10, 2009 at 4:06 am
i am not sure whether this will help.
normally, i will do a full backup of the db and modify its path during restoration. 🙂
kinda stupid but it works all the time for me.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply