January 13, 2006 at 8:16 am
Hello guys.
I'm wondering how to change the logical name to a DB. I mean the "name" column in this sentence
select * from sysfiles
A clear example is when you have the test and production databases in the same server and restore one of them to the other; the name column will keep the old DB name.
I've reviewed sp_rename% or sp_change% SP's but none of them seem to be helpful.
Any clue?
January 13, 2006 at 8:55 am
When you restore your test db you should use the
WITH MOVE option to rename your files.
You cannot rename the files of a database.
January 13, 2006 at 4:28 pm
And what about taking dettach-rename-reattach? As far as I understand this will leave us with the old "name" too, but without a way to change it :-
I know to lurk in systables is not recomended, but maybe is this a way?
January 14, 2006 at 10:20 am
Isn't this done using
ALTER DATABASE X
MODIFY FILE (NAME = logical_file_name, NEWNAME = new_logical_name...).
January 16, 2006 at 8:02 am
Yes, that works!
Thank you!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy