How to modify the mssqlserver Database Name

Source: Internet
Author: User
Tags mssqlserver
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.