The method for modifying the mssqlserver database name is as follows.
The method for modifying the mssqlserver database name is as follows.
Take SQLServer 20000 as an example. The old name is Admin10000 and the new database name is 111cn.net.
Step 1. Back up the database
Open Enterprise Manager
-- Right-click a database
-- All tasks
-- Backup database
-- Purpose -- select Add from backup
-- Enter a backup file name (Note: if there is a file name, delete it)
-- OK
Step 2: Restore the database, specify a new database name, and modify the physical file name.
Enterprise Manager -- Right-click "Database" -- all tasks -- Restore database
-- Enter the restored database name 111cn.net in "Restore to Database"
-- Restore select "from device" -- select device -- add your backup file -- OK, and return to the database restoration page.
-- Backup number -- Select Content -- select the backup content you want to restore
-- Option -- change the physical file name in "move to physical file name" to the name of your Data file to be stored. Here, change it to 111cn.net _ Data. MDF (database file) and 111cn.net _ Log. LDF (Log File)
-- If the database to be restored already exists, select "Force restore on the existing database"
-- OK
Step 3: Modify the logical file name
If you want to modify the logical file name, you can enter
Alter database [111cn.net]
Modify file (name = 'admin10000 _ data', newname = '111cn. net_Data ')
Alter database [111cn.net]
Modify file (name = 'admin10000 _ log', newname = '111cn. net_log ')
Step 4: Delete the old database 111cn