The MSSQL server database is not attached to solution sharing _mssql

Source: Internet
Author: User
Tags microsoft sql server mssql mssql server create database

Error 15105, from the Internet to find some solutions, is generally said that the lack of permissions on the file,

Of course, the additional time must have the database additional permissions to operate.

Workaround 1: Give the appropriate MDF file Control permission, if you do not know what users can go to the SQL Server Configuration Center to find

But I can not do this with the above method.

Workaround 2: Try another user, my original database is used SA landing, I try to use SA landing, the additional success! ~

If the repeated use of the SA landing but failed to login, may be not open permissions.

Permissions can be set in the login user's options, allowing landing.

The authentication mode can be set at the server, and the hybrid login mode is selected.

In addition to the high version of the data attached to the lower version of the database can also try the above method.

In fact, I personally prefer to use the method of generating scripts to guide the structure and data.


Perform sp_attach_db or sp_attach_single_file_db in QA, prompting: Error 1813: Failed to open new database ' dbname ', create DB will terminate. Device activation error. Physical filename ' d:\sql server\mssql\data\dbname _log.ldf ' may be wrong!
Follow the steps below to process:
1. Create a new database with the same name
2. Stop the SQL Server service (be careful not to detach the database)
3. Overwrite the new database with the data file of the original database
4. Restart SQL Server services
5. When you open Enterprise Manager, there will be doubt, regardless, execute the following statement (note modify the database name)
6. After the completion of the general access to the data in the database. At this point, the database itself generally has problems, the solution is to use the script of the database to create a new database, and then through DTS to guide the data in the line

Copy Code code as follows:

Use master go sp_configure ' allow updates ', 1 reconfigure with override go update sysdatabases set status =32768 where name = ' Suspect database name ' Go sp_dboption ' suspect database name ', ' Single user ', ' true ' go dbcc CHECKDB (' Suspect database name ') go update sysdatabases set status =2 8 where name= ' suspect database name ' Go sp_configure ' allow updates ', 0 reconfigure with override go sp_dboption ' suspect database name ', ' single user ', ' false ' go


1813 error Resolution for SQL Server 2000 attached database

A bad operation was made today.

Database Xxzx_discuz, due to generate a large number of logs so that the log file ' Xxzx_discuz_log.ldf ' full of disk space, so that the site can not use the database normally.

Own diagram Save the database xxzx_discuz, delete the ' xxzx_discuz_log.ldf ' (because the file is too large to be stored to the Recycle Bin), the attachment to SQL Server when the two prompts:
--------------------------------------------------------------------------------------------------------------- ---------------
SQL Server Enterprise Manager
---------------------------
The filename specified for the log file is incorrect.
A new log file will be created.
Do you want to continue?
---------------------------
Yes (Y) No (N)
--------------------------------------------------------------------------------------------------------------- ---------------
Microsoft SQL-DMO (ODBC sqlstate:42000)
---------------------------
Error 1813: Failed to open new database ' Xxzx_discuz '. The CREATE DATABASE will terminate.
Device activation error. The physical filename ' S:\Program Files\Microsoft SQL Server\mssql\data\xxzx_discuz_log.ldf ' may be incorrect.
---------------------------
Are you sure
--------------------------------------------------------------------------------------------------------------- ---------------

It is not possible to attach the database properly to SQL Server 2000, which is normally not a problem, and SQL Server rebuilds the log file, but because of the lack of disk space before, the log file is incomplete, resulting in an inability to attach properly.

The solution is as follows (found from the Internet):

0. Backup data file ' Xxzx_discuz_log.mdf '
1. Create a new database with the same name ' Xxzx_discuz '
2. Stop the SQL Server service (be careful not to detach the database)
3. Overwrite the new database with the data file ' Xxzx_discuz_log.mdf ' of the original database

4. Restart SQL Server services
5. When you open Enterprise Manager, you will be questioned, regardless, execute the following statement (note modify the database name) 6. You can usually access the data in the database when you are done. At this point, the database itself generally has problems, the solution is to use the database script to create a new database, and then through DTS to guide the data into the line. SQL code
Copy Code code as follows:

Use master
Go
sp_configure ' allow updates ', 1 reconfigure with override
Go
Update sysdatabases set status =32768 where Name= ' suspect database name '
Go
sp_dboption ' suspect database name ', ' Single user ', ' true '
Go
DBCC CHECKDB (' Suspect database name ')
Go
Update sysdatabases set status =28 where Name= ' suspect database name '
Go
sp_configure ' allow updates ', 0 reconfigure with override
Go
sp_dboption ' suspect database name ', ' Single user ', ' false '
Go

Pay special attention to the instructions in the last step "at this point, the database itself is generally problematic, the solution is to use the script of the database to create a new database, and then through DTS to guide the data in the line" reference article: 1813 error Resolution for SQL Server attached database

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.