SQL System.Data.SqlClient.SqlError: Cannot overwrite file ' C:\Program Files\Microsoft SQL Server\mssql\data\itsm_data.mdf '. The database ' my1 ' is using the solution for this file

Source: Internet
Author: User
Tags mssql

"SQL System.Data.SqlClient.SqlError: Unable to overwrite file ' C:\Program Files\Microsoft SQL Server\mssql\data\itsm_" When restoring a database backup Data.mdf '. The database ' my1 ' is using the file ' problem.

Cause: When restoring a database backup file in two databases, this problem occurs primarily because restoring the first database is the same as the name of the second database, and the path is the same as the first database restore path when the second database is restored with a physical path.

Solution: 1. Name the second database to be different from the first one. Make a note of the location where you just created the second database.

2. Right click on the newly created database, restore operation, pop up the following window, select the path of the backup file on the original device, select the database restore file.

3. Click "Options" on the left. Pop:

Choosing the path in the red box to match the path you just built the database is the key to solving the problem.

4. Two paths Select the location of the database you just built

After modifying the path, the restore operation will not error.

SQL System.Data.SqlClient.SqlError: Cannot overwrite file ' C:\Program Files\Microsoft SQL Server\mssql\data\itsm_data.mdf '. The database ' my1 ' is using the solution for this file

Related Article

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.