This is something I've always wondered. I know how to change the actual nam
e
of the mdf and ldf files on disk. You just detach, change the names on the
disk and reattach with the new names. But how do you change the logical
names of the mdf and ldf files, i.e. the names that you use when you do a
restore with move'CLM,
After restoring the database using "move" option, you can use "alter
database" to change the logical name of the files.
alter database northwind
modify file (name=northwind, newname=northwind_data)
go
exec sp_helpdb northwind
go
AMB
"CLM" wrote:
> This is something I've always wondered. I know how to change the actual n
ame
> of the mdf and ldf files on disk. You just detach, change the names on th
e
> disk and reattach with the new names. But how do you change the logical
> names of the mdf and ldf files, i.e. the names that you use when you do a
> restore with move'|||CLM,
After restoring the database using "move" option, you can use "alter
database" to change the logical name of the files.
alter database northwind
modify file (name=northwind, newname=northwind_data)
go
exec sp_helpdb northwind
go
AMB
"CLM" wrote:
> This is something I've always wondered. I know how to change the actual n
ame
> of the mdf and ldf files on disk. You just detach, change the names on th
e
> disk and reattach with the new names. But how do you change the logical
> names of the mdf and ldf files, i.e. the names that you use when you do a
> restore with move'
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment