Меню

Microsoft sql server ошибка 2571

  • Remove From My Forums
  • Question

  • Good day to you.
    I try to attach a database mdf file to Microsoft SQL server 2014 on Amazon Elastic Computing Cloud, EC2, but fail with the following message, 
    «User ‘guest’ does not have permission to run DBCC checkprimaryfile. (Microsoft SQL Server, Error: 2571)»
    The ID I use to REMOTE login has administrator rights and I have chosen to «run as administrator»
    Please help, and thanks.

Answers

  • Hi go9189,

    According to your description, you come across the error that User ‘guest’ does not have permission to run DBCC checkprimaryfile. This issue could happen when the login account doesn’t have CREATE DATABASE, CREATE ANY DATABASE,
    or ALTER ANY DATABASE permission in SQL Server instance, or that the login account has no access to the mdf and ldf files when attaching database, so SQL Server recognize the login account as a «Guest».

    To solve the issue, you could pay attention to the points below.

    1. Ensure that the login account has at least CREATE DATABASE, CREATE ANY DATABASE, or ALTER ANY DATABASE permission. You could grant the fixed server role ‘dbcreator’ or ‘sysadmin’ to the login account following the steps below.

    a. Connect to SQL Server instance with the login account which has sysadmin fix server role.

    b. Expand the folder ‘Security’, right click the login, and select Properties.

    c. In the Server Roles tab, check the checkbox for ‘dbcreator’ or ‘sysadmin’.

    2. Make sure that the the login account has full control permission on the mdf and ldf files. For how to grant the login account with full control permission on the mdf and ldf files, please refer to the steps in the following article:
    http://msdn.microsoft.com/en-us/library/bb727008.aspx

    There is a similar thread for your reference:
    https://social.technet.microsoft.com/Forums/en-US/e463df4c-8d26-46cf-aa2e-bddd97c7a9b8/user-guest-does-not-have-permission-to-run-dbcc-checkprimaryfile?forum=sqlgetstarted

    Regards,
    Michelle Li

    • Edited by

      Tuesday, January 20, 2015 2:18 PM

    • Proposed as answer by
      Michelle Li
      Friday, January 23, 2015 1:47 AM
    • Marked as answer by
      Lydia ZhangMicrosoft contingent staff
      Tuesday, January 27, 2015 3:49 AM

  • Remove From My Forums
  • Question

  • Good day to you.
    I try to attach a database mdf file to Microsoft SQL server 2014 on Amazon Elastic Computing Cloud, EC2, but fail with the following message, 
    «User ‘guest’ does not have permission to run DBCC checkprimaryfile. (Microsoft SQL Server, Error: 2571)»
    The ID I use to REMOTE login has administrator rights and I have chosen to «run as administrator»
    Please help, and thanks.

Answers

  • Hi go9189,

    According to your description, you come across the error that User ‘guest’ does not have permission to run DBCC checkprimaryfile. This issue could happen when the login account doesn’t have CREATE DATABASE, CREATE ANY DATABASE,
    or ALTER ANY DATABASE permission in SQL Server instance, or that the login account has no access to the mdf and ldf files when attaching database, so SQL Server recognize the login account as a «Guest».

    To solve the issue, you could pay attention to the points below.

    1. Ensure that the login account has at least CREATE DATABASE, CREATE ANY DATABASE, or ALTER ANY DATABASE permission. You could grant the fixed server role ‘dbcreator’ or ‘sysadmin’ to the login account following the steps below.

    a. Connect to SQL Server instance with the login account which has sysadmin fix server role.

    b. Expand the folder ‘Security’, right click the login, and select Properties.

    c. In the Server Roles tab, check the checkbox for ‘dbcreator’ or ‘sysadmin’.

    2. Make sure that the the login account has full control permission on the mdf and ldf files. For how to grant the login account with full control permission on the mdf and ldf files, please refer to the steps in the following article:
    http://msdn.microsoft.com/en-us/library/bb727008.aspx

    There is a similar thread for your reference:
    https://social.technet.microsoft.com/Forums/en-US/e463df4c-8d26-46cf-aa2e-bddd97c7a9b8/user-guest-does-not-have-permission-to-run-dbcc-checkprimaryfile?forum=sqlgetstarted

    Regards,
    Michelle Li

    • Edited by

      Tuesday, January 20, 2015 2:18 PM

    • Proposed as answer by
      Michelle Li
      Friday, January 23, 2015 1:47 AM
    • Marked as answer by
      Lydia ZhangMicrosoft contingent staff
      Tuesday, January 27, 2015 3:49 AM

  • Remove From My Forums
  • Question

  • Good day to you.
    I try to attach a database mdf file to Microsoft SQL server 2014 on Amazon Elastic Computing Cloud, EC2, but fail with the following message, 
    «User ‘guest’ does not have permission to run DBCC checkprimaryfile. (Microsoft SQL Server, Error: 2571)»
    The ID I use to REMOTE login has administrator rights and I have chosen to «run as administrator»
    Please help, and thanks.

Answers

  • Hi go9189,

    According to your description, you come across the error that User ‘guest’ does not have permission to run DBCC checkprimaryfile. This issue could happen when the login account doesn’t have CREATE DATABASE, CREATE ANY DATABASE,
    or ALTER ANY DATABASE permission in SQL Server instance, or that the login account has no access to the mdf and ldf files when attaching database, so SQL Server recognize the login account as a «Guest».

    To solve the issue, you could pay attention to the points below.

    1. Ensure that the login account has at least CREATE DATABASE, CREATE ANY DATABASE, or ALTER ANY DATABASE permission. You could grant the fixed server role ‘dbcreator’ or ‘sysadmin’ to the login account following the steps below.

    a. Connect to SQL Server instance with the login account which has sysadmin fix server role.

    b. Expand the folder ‘Security’, right click the login, and select Properties.

    c. In the Server Roles tab, check the checkbox for ‘dbcreator’ or ‘sysadmin’.

    2. Make sure that the the login account has full control permission on the mdf and ldf files. For how to grant the login account with full control permission on the mdf and ldf files, please refer to the steps in the following article:
    http://msdn.microsoft.com/en-us/library/bb727008.aspx

    There is a similar thread for your reference:
    https://social.technet.microsoft.com/Forums/en-US/e463df4c-8d26-46cf-aa2e-bddd97c7a9b8/user-guest-does-not-have-permission-to-run-dbcc-checkprimaryfile?forum=sqlgetstarted

    Regards,
    Michelle Li

    • Edited by

      Tuesday, January 20, 2015 2:18 PM

    • Proposed as answer by
      Michelle Li
      Friday, January 23, 2015 1:47 AM
    • Marked as answer by
      Lydia ZhangMicrosoft contingent staff
      Tuesday, January 27, 2015 3:49 AM

SQL server error 2571 triggers while trying to attach the MDF and LDF files. This error message indicates that the User does not have the permission to run DBCC checkprimaryfile to attach the database.

As a part of our Server Management Services, we help our Customers to fix SQL related errors regularly.

Let us today discuss the possible causes and fixes for this error.

What is SQL server error 2571?

Users often need to attach the databases either after a server upgrade or during a recovery. SQL server error 2571 triggers while trying to attach the MDF and LDF files

A typical error message looks like:

SQL server error 2571

It generally happens due to insufficient permission of the user requesting the action. Let us now look into the steps to fix the issue.

How to fix SQL server error 2571?

As we discussed earlier , the error generally happens due to insufficient permission of the user to execute the task.

For instance, it happens when the SQL user login used is a part of the public role. Providing SYSADMIN rights to this account will help to solve it and bypass the error.

To Grant full control to the .MDF and .LDF files to user account, right click the files, select Properties, and modify the required fields in the Security tab.

However, it is not a good idea to give SYSADMIN rights to someone who just want to attach the database files. A better solution would be to use T-SQL to attach the database and provide dbcreator role to the login who is trying to attach the files.

CREATE DATABASE SQLAuthority
ON (FILENAME = 'F:DataSQLAuth.mdf'),
(FILENAME = 'F:LogSQLAuth_log.ldf')
FOR ATTACH;

Above command requires CREATE DATABASE, CREATE ANY DATABASE, or ALTER ANY DATABASE permission.

Apart from the above steps to change permission to attach the database, a best way is to copy the database. We could copy over the backup file and restore the database from it.

[Need any further assistance in fixing SQL errors? – We’re available 24*7]

Conclusion

In short, SQL server error 2571 triggers while trying to attach the MDF and LDF files. This error message indicates that the user does not have the permission to run DBCC checkprimaryfile to attach the database. Today, we saw how our Support Engineers fix this error.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

hi

I am using sql server 2005 sp4 and running win7 sp1 when i attach database my own pc it will attached normally but when i install the sql 2005 sp4 on client pc running on windows 8 and attaching the same database there the management studio shows the following
error msg 

TITLE: Microsoft SQL Server Management Studio Express
——————————

Failed to retrieve data for this request. (Microsoft.SqlServer.Express.SmoEnum)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&LinkId=20476

——————————
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Express.ConnectionInfo)

——————————

User ‘guest’ does not have permission to run DBCC checkprimaryfile. (Microsoft SQL Server, Error: 2571)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.5000&EvtSrc=MSSQLServer&EvtID=2571&LinkId=20476

how to resolve this issue

Error 2571 — not permission to run DBCC TRACEON

Discussion in ‘microsoft.public.sqlserver.server’ started by Soren, Jan 19, 2006.

  1. Hi,

    I am trying to connect to SQL Server 2005 via Excel/ODBC. (ODBC Test IS
    successfull) and get the following error after entering Login ID and Password:

    Connection failed:
    SQLState: ‘37000’
    SQL Server Error: 2571
    ……does not have permission to run DBCC TRACEON

    Security setup on SQL Server seems to be fine (I can connect to SQL Server
    from Reporting Services on same Login/Password).

    Any idears?

    Best regards,

    Soren

    1. Advertisements

  2. To run DBCC Traceon you requires membership in the sysadmin fixed
    server role.

    Regards
    Amish

    1. Advertisements

  3. I had the same problem, but there are multiple users who use that
    spreadsheet using Windows authentication. I did not want any of them to
    be sysadmins. They only had SLECT permissions to certain tables. In my
    case, deleting the Application name (from the SQL Server Login dialog)
    fixed it. You need to click the Options button on the dialog to see
    this. The application name seems to be an issue if it has certain
    characters (like ® in Microsoft® Query). Depending on the MS Office
    version, the default value may be Microsoft® Query/MS Office XP/??.

    You can also programmatically change the connection string (and even
    the command text if necessary). Here is a sample.

    ‘ChangeConnection
    Sub ChangeConnection()

    Dim sh As Worksheet
    Dim qt As QueryTable

    Dim sConnection As String

    For Each sh In ActiveWorkbook.Sheets
    For Each qt In sh.QueryTables

    ‘Show current connectionstring
    MsgBox («Tab: » & sh.Name & vbCr & » Current Connection: «
    & vbCr & qt.Connection)
    ‘Show current query
    MsgBox («Tab: » & sh.Name & vbCr & «Current Query: » & vbCr
    & qt.CommandText)

    ‘Change Connection
    qt.Connection = «ODBC;DRIVER=SQL
    Server;SERVER=myserver;DATABASE=myDB;Trusted_Connection=Yes;APP=Excel_TopCustomers;»

    ‘Change Qry text (the owner for instance)
    qt.CommandText = Replace(qt.CommandText, «DB.dbo.»,
    «DB.Me»)

    qt.SavePassword = False

    ‘Show new connectionstring
    MsgBox («Tab: » & sh.Name & vbCr & «Connection: » & vbCr &
    qt.Connection)
    ‘Show new query
    MsgBox («Tab: » & sh.Name & vbCr & «Query: » & vbCr &
    qt.CommandText)

    Next qt
    Next sh

    End Sub

  4. I have the exact same problem using Excel 97/MS-Query8. I tried your
    suggestion, it did not work. I am still getting the error.

  5. Sorry my mistake, it does work. You have to replace the string «Microsoft®
    Query» with something else.

    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You’ll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.


MSSQL Forums

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Microsoft sql server ошибка 229
  • Microsoft sql server ошибка 223