Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
tribune
Posting Yak Master
105 Posts |
Posted - 2005-03-15 : 17:21:14
|
| I just used this script to rename my database, but the file names .mdf and .ldf are the old nameEXEC sp_dboption 'OldDbName', 'Single User', 'TRUE'EXEC sp_renamedb 'OldDbName', 'NewDbName'EXEC sp_dboption 'NewDbName', 'Single User', 'FALSE'-------------sp_renamedb doesn't rename the actual file names and logical file namesis there an easy way to do this? thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-03-15 : 17:25:26
|
| You can use ALTER DATABASE MODIFY FILE to rename the logical file names. To rename the actual files, you can detach the database, rename the files, then attach it with the new names.Tara |
 |
|
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2005-03-15 : 17:27:06
|
ALTER DATABASE MODIFY FILE NAME = logical_file_name, NEWNAME = new_logical_nameALTER DATABASE MODIFY FILE NAME = logical_file_name, FILENAME = os_file_nameSee ALTER DATABASE in BOL... just trying to catch up... oh well...rockmoose |
 |
|
|
|
|
|