The original database name is AA, the physical file name is called Aa.mdf and aa_log.ldf; you need to modify the database name to BB, the physical file name is called Bb.mdf and Bb_log.ldf; procedure (take the sqlserver2005 operation as an example): Prepare the original database Copy (select Database, right-click Task-to-backup), is divided into Aa.bak; create a new database BB, and then right-click the task, restore database, select Source device, browse, jump out of the Specify Backup dialog box, Click Add to find the Aa.bak that you just backed up; Select the backup set to restore, select the backup set you want to restore, select options on the Restore Database option page, click on Overwrite existing database in Restore options, specify the path after the restore and the name Bb.mdf and bb_ log.ldf; Database list select BB Database, right-click Properties---file, in the Database File Small window, respectively, modify the "logical name" as: BB and bb_log; At this point, the database has been completely renamed.
SQL SERVER 2005 modifies the database name, including the physical file name and logical name