Microsoft sql server ошибка 948

Yesterday I installed SQL Server 2008 on my laptop (Windows 7 64 bit), I need to attach a .mdf to the server, but when I try to do this, I get this error:

Attach Database failed for server ‘prince/sqlexpress’ (Microsoft.SqlServer.smo)

ADDITIONAL INFORMATION:
1.An Exception Occured while executing a Transact Sql statement or Batch (Microsoft.SqlServer.connectioninfo)

2.Unable to open the Physical file Operating system error 5: «5(Access is denied.)». (Microsoft SQL Server, Error: 5120)

With the help of Internet, I found some solution.

1.Start SQL Server manager as Administrator (right-click on the program, choose «Start as administrator»):

But I still got the same error.

That .mdf file does have have permission, so I moved into external drive (pendrive because my system have only C: drive, yet no partition I have done ) .

Then I got another error,

Attach database failed for Server ‘PrinceSQLEXPRESS’.
(Microsoft.SqlServer.Smo) ADDITIONAL INFORMATION:

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

The database ‘Databasename’ cannot be opened because it is version
655. This server supports version 611 and earlier. A downgrade path is not supported. Could not open new database ‘Databasename’. CREATE
DATABASE is aborted. (Microsoft SQL Server, Error: 948)

I use the Query —

«select @@version;»

I got the Output as

«Microsoft SQL Server 2005 — 9.00.3042.00 (Intel X86) Feb 9 2007
22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition
on Windows NT 6.1 (Build 7600: )»

what shall i do? But i installed SQL Server 2008. how do i change that?
How to solve this error, please help out this problem, If you have any solution please post it.

Permalink

Cannot retrieve contributors at this time

title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords

MSSQLSERVER_948

MSSQLSERVER_948

MashaMSFT

mathoma

04/04/2017

sql

supportability

reference

948

948 (Database Engine error)

MSSQLSERVER_948

[!INCLUDE SQL Server]

Details

Attribute Value
Product Name SQL Server
Event ID 948
Event Source MSSQLSERVER
Component SQLEngine
Symbolic Name NA
Message Text The database ‘%.*ls’ cannot be opened because it is version %d. This server supports version %d and earlier. A downgrade path is not supported.

Explanation

Certain features in [!INCLUDEssNoVersion] affect the structure of the database files. When you attach a database to another instance of [!INCLUDEssNoVersion], the file format might not be compatible with a different version of the [!INCLUDEssDE].

For example, this error can be caused by using the vardecimal storage format in a later version of [!INCLUDEssNoVersion] and then trying to attach the database files in a version earlier than [!INCLUDEssVersion2005] Service Pack 2.

User Action

Determine the version of [!INCLUDEssNoVersion] that is running on the originating server. In [!INCLUDEssManStudioFull], either right-click the server and then click Properties or type SELECT @@VERSION in a query window. Open the database by using the original version of [!INCLUDEssNoVersion]. Investigate the features that are enabled on the original database in the instance of [!INCLUDEssNoVersion]. Modify these settings to work with the version of [!INCLUDEssNoVersion] in which the database will be attached.

Yesterday I installed SQL Server 2008 on my laptop (Windows 7 64 bit), I need to attach a .mdf to the server, but when I try to do this, I get this error:

Attach Database failed for server ‘prince/sqlexpress’ (Microsoft.SqlServer.smo)

ADDITIONAL INFORMATION:
1.An Exception Occured while executing a Transact Sql statement or Batch (Microsoft.SqlServer.connectioninfo)

2.Unable to open the Physical file Operating system error 5: «5(Access is denied.)». (Microsoft SQL Server, Error: 5120)

With the help of Internet, I found some solution.

1.Start SQL Server manager as Administrator (right-click on the program, choose «Start as administrator»):

But I still got the same error.

That .mdf file does have have permission, so I moved into external drive (pendrive because my system have only C: drive, yet no partition I have done ) .

Then I got another error,

Attach database failed for Server ‘PrinceSQLEXPRESS’.
(Microsoft.SqlServer.Smo) ADDITIONAL INFORMATION:

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

The database ‘Databasename’ cannot be opened because it is version
655. This server supports version 611 and earlier. A downgrade path is not supported. Could not open new database ‘Databasename’. CREATE
DATABASE is aborted. (Microsoft SQL Server, Error: 948)

I use the Query —

«select @@version;»

I got the Output as

«Microsoft SQL Server 2005 — 9.00.3042.00 (Intel X86) Feb 9 2007
22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition
on Windows NT 6.1 (Build 7600: )»

what shall i do? But i installed SQL Server 2008. how do i change that?
How to solve this error, please help out this problem, If you have any solution please post it.

Yesterday I installed SQL Server 2008 on my laptop (Windows 7 64 bit), I need to attach a .mdf to the server, but when I try to do this, I get this error:

Attach Database failed for server ‘prince/sqlexpress’ (Microsoft.SqlServer.smo)

ADDITIONAL INFORMATION:
1.An Exception Occured while executing a Transact Sql statement or Batch (Microsoft.SqlServer.connectioninfo)

2.Unable to open the Physical file Operating system error 5: «5(Access is denied.)». (Microsoft SQL Server, Error: 5120)

With the help of Internet, I found some solution.

1.Start SQL Server manager as Administrator (right-click on the program, choose «Start as administrator»):

But I still got the same error.

That .mdf file does have have permission, so I moved into external drive (pendrive because my system have only C: drive, yet no partition I have done ) .

Then I got another error,

Attach database failed for Server ‘PrinceSQLEXPRESS’.
(Microsoft.SqlServer.Smo) ADDITIONAL INFORMATION:

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

The database ‘Databasename’ cannot be opened because it is version
655. This server supports version 611 and earlier. A downgrade path is not supported. Could not open new database ‘Databasename’. CREATE
DATABASE is aborted. (Microsoft SQL Server, Error: 948)

I use the Query —

«select @@version;»

I got the Output as

«Microsoft SQL Server 2005 — 9.00.3042.00 (Intel X86) Feb 9 2007
22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition
on Windows NT 6.1 (Build 7600: )»

what shall i do? But i installed SQL Server 2008. how do i change that?
How to solve this error, please help out this problem, If you have any solution please post it.

  • Remove From My Forums
  • Question

  • Hello

    I get the following error when trying to attach a database:

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

    Attach database failed for Server ‘WLKCNU11216XJSQLEXPRESS’.  (Microsoft.SqlServer.Smo)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.2100.60+((SQL11_RTM).120210-1917+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

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

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

    ——————————

    The database ‘C:PROGRAM FILESMICROSOFT SQL SERVERMSSQL10_50.SQLEXPRESSMSSQLDATAADVENTUREWORKS2012_DATA.MDF’ cannot be opened because it is version 706. This server supports version 661 and earlier. A downgrade path is not supported.
    Could not open new database ‘C:PROGRAM FILESMICROSOFT SQL SERVERMSSQL10_50.SQLEXPRESSMSSQLDATAADVENTUREWORKS2012_DATA.MDF’. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=948&LinkId=20476

    ——————————
    BUTTONS:

    OK
    ——————————

    I suspect the database has been developed in SQL 2012, so I’ve ran SELECT @@VERSION in my version of SQL 2012, which returns:

    Microsoft SQL Server 2008 R2 (RTM) — 10.50.1600.1 (X64)
        Apr  2 2010 15:48:46
        Copyright (c) Microsoft Corporation
        Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

    I have SQL 2008 R2 installed, as well as SQL Server Management Studio 2012. Why is SQL 2008 being picked up in my version of 2012? Does this have something to do with the services which are running in Configuration Manager?

    Any help would be appreciated, thanks.

Answers

  • The database ‘C:PROGRAM FILESMICROSOFT SQL SERVERMSSQL10_50.SQLEXPRESSMSSQLDATAADVENTUREWORKS2012_DATA.MDF’ cannot be opened because it
    is version 706. This server supports version 661 and earlier. A downgrade path is not supported.
    Could not open new database ‘C:PROGRAM FILESMICROSOFT SQL SERVERMSSQL10_50.SQLEXPRESSMSSQLDATAADVENTUREWORKS2012_DATA.MDF’. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)

    I have SQL 2008 R2 installed,

    Hello,

    Your are trying to attach a SQL Server 2012 (=version 706) database to a SQL Server 2008R2, an older version; this don’t work, you can’t attach a database of a newer version.


    Olaf Helper

    Blog
    Xing

    • Marked as answer by

      Monday, November 26, 2012 1:26 AM

  • Remove From My Forums
  • Question

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

    Attach database failed for Server ‘DELL-ZAKWAN’.  (Microsoft.SqlServer.Smo)

    For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=16.100.37971.0&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476

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

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

    ——————————

    The database ‘MnrAccDBTR’ cannot be opened because it is version 904. This server supports version 869 and earlier. A downgrade path is not supported.
    Could not open new database ‘MnrAccDBTR’. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)

    • Edited by

      Sunday, June 28, 2020 3:01 PM

I tried to attach a database (.mdf) file and I got this error:

Attach database failed for Server '...SQLINSTANCE'. (Microsoft.SqlServer.Smo)

Additional information:
     An exception occured while executing a Transact-SQL statement or batch.
     (Microfost.SqlServer.ConnectionInfo)
          The database 'DBName' cannot be opened because it is version 782. This server supports version 706 or earlier. A downgrade path is not supported.
Could not open new database 'DBName'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 948)

P.S. I have installed SQL Server 2012 Express, and database ‘DBName’ has been made in Visual Studio 2012.

jackJoe's user avatar

jackJoe

11k8 gold badges48 silver badges64 bronze badges

asked Apr 10, 2014 at 9:05

Faruk's user avatar

6

If you have source control

  1. Rollback the mdf file
  2. Rollback the idf file (log file) to the same version

I had a similar problem and this solution fixed is.

If you do not have source control and you are using Code First

  1. Backup the mdf and idf files
  2. Delete the mdf and idf files in the solution explorer
  3. Create a new database from project->add new item->data->SQL server database
  4. In the package manager console write «Enable-migrations» then «Add-migration init» then «Update-database» to create your tables in the database.

For me, if things got too complicated, I would just recreate the project and copy the code :)

answered Sep 5, 2014 at 19:51

Amri's user avatar

AmriAmri

1,0309 silver badges14 bronze badges

Вопрос:

Вчера я установил SQL Server 2008 на своем ноутбуке (Windows 7 64 бит), мне нужно подключить .mdf к серверу, но когда я попытаюсь это сделать, я получаю эту ошибку:

Не удалось привязать базу данных к серверу “принц/sqlexpress” (Microsoft.SqlServer.smo)

ДОПОЛНИТЕЛЬНАЯ ИНФОРМАЦИЯ: 1.An Исключение При выполнении инструкции Transact Sql или пакета (Microsoft.SqlServer.connectioninfo)

2.Unable для открытия физического файла Ошибка операционной системы 5: “5 (Доступ запрещен.)”. (Microsoft SQL Server, ошибка: 5120)

С помощью Интернета я нашел какое-то решение.

1. Запустите диспетчер SQL Server в качестве администратора (щелкните правой кнопкой мыши по программе, выберите “Начать как администратор”):

Но у меня все еще была такая же ошибка.

У этого .mdf файла есть разрешение, поэтому я перешел на внешний диск (pendrive, потому что у моей системы есть только диск C:, но никакого раздела я не сделал).

Затем я получил еще одну ошибку,

Не удалось привязать базу данных к серверу “ПринцSQLEXPRESS”.
(Microsoft.SqlServer.Smo) ДОПОЛНИТЕЛЬНАЯ ИНФОРМАЦИЯ:

Исключение произошло при выполнении инструкции Transact-SQL или партии. (Microsoft.SqlServer.ConnectionInfo)

База данных “Databasename” не может быть открыта, потому что это версия 655. Этот сервер поддерживает версию 611 и ранее. Путь вниз не поддерживается. Не удалось открыть новую базу данных “Databasename”. CREATE DATABASE прервана. (Microsoft SQL Server, ошибка: 948)

Я использую Query –

“select @@version;”

Я получил результат как

“Microsoft SQL Server 2005 – 9.00.3042.00 (Intel X86) 9 февраля 2007 г. 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition в Windows NT 6.1 (Build 7600:)”

что мне делать? Но я установил SQL Server 2008. Как мне это изменить? Как решить эту ошибку, пожалуйста, помогите решить эту проблему. Если у вас есть решение, отправьте его.

Лучший ответ:

Сообщение очень ясно: файл MDF базы данных имеет версию 655. Ваш сервер понимает версию 611. Это означает, что, несмотря на ваши требования об обратном, вы подключены к SQL Server 2005. Установите SQL Server 2008, подключитесь к нему и прикрепите свою базу данных. Во время процесса установки обратите внимание на выбранное имя экземпляра и убедитесь, что вы подключаетесь к этому экземпляру. Вы также можете проверить, какие экземпляры вы установили, посмотрите, какие услуги у вас есть в вашей системе. MSSQLSERVER будет экземпляром по умолчанию, MSSQL$<instancename> будет именованным экземпляром. Используйте любой инструмент запросов SCM, чтобы узнать, какие службы вы установили, например. sc.exe.

Ответ №1

Microsoft SQL Server Management Studio нуждается в правах администратора для присоединения базы данных в Windows 7. Если вы выполняете ее напрямую, чтобы получить ошибку 5120. Исправьте это выполнение значка Management Studio с помощью правой кнопки мыши и выберите выполнение как администратор. Удачи.

Ответ №2

Наконец, я решил свою проблему,

Остановите службу SQLEXPRESS и удалите все компоненты, связанные с SQL-сервером 2005. Затем откройте редактор реестра. Перейдите в HKEY_LOCAL_MACHINE – ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ – MICROSOFT – MICROSOFT SQL SERVER-DELETE папку 90. Затем снова переустановите SQL Server 2008 и создайте новый instanse для сервера 2008 года. Теперь он работает, я могу подключить файл mdf.


  • Hello dear!

    I am facing a problem with MS SQL Server 2008 R2 while attaching a database file, the error code is 948, I tried to solve it but still me getting same error so please help me to solve this critical problem

  • Gail Shaw

    SSC Guru

    Points: 1004494

    What are the error messages? I don’t have all of the error codes memorised.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

  • arzmohd2k8

    Old Hand

    Points: 306

    This error occurred while attaching database file:

    An exception was occurred while executing a-trasact SQL Statment or Batch

    (Microsoft.SqlServer.ConnectionInfo)

    Database connectivity cannot be opened because it is version 661. This server support version 655 and earlier

    A downgrade path is not supported.

    Could not open new database ‘connectivity’. CREATE DATABASE aborted. (Microsoft SqlServer, Error:948)

  • enriquemallon

    Ten Centuries

    Points: 1239

    The unit of work was initiated before DDF was started, and the application attempted to perform a distributed operation. The unit of work must be terminated by a rollback operation.

    An application that performs local database updates before DDF is started cannot perform distributed operations within the same unit of work. The current unit of work must be terminated by a rollback operation and a new unit of work must be initiated before any SQL operations can be performed.

  • Gail Shaw

    SSC Guru

    Points: 1004494

    enriquemallon (8/13/2014)


    The unit of work was initiated before DDF was started, and the application attempted to perform a distributed operation. The unit of work must be terminated by a rollback operation.

    An application that performs local database updates before DDF is started cannot perform distributed operations within the same unit of work. The current unit of work must be terminated by a rollback operation and a new unit of work must be initiated before any SQL operations can be performed.

    ??? Posted in the wrong thread by accident?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

  • Gail Shaw

    SSC Guru

    Points: 1004494

    arzmohd2k8 (8/13/2014)


    Database connectivity cannot be opened because it is version 661. This server support version 655 and earlier

    A downgrade path is not supported.

    You’re trying to attach a SQL Server 2008 R2 database to SQL Server 2008. They are different versions (like SQL 2012 and SQL 2014). You cannot downgrade databases.

    You’ll have to find a SQL Server 2008 R2 instance to attach this DB to.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

  • quackhandle1975

    SSChampion

    Points: 11055

    GilaMonster (8/12/2014)


    What are the error messages? I don’t have all of the error codes memorised.

    An expert would. 😉

    qh

    [font=»Tahoma»]Who looks outside, dreams; who looks inside, awakes. – Carl Jung.[/font]

  • Gail Shaw

    SSC Guru

    Points: 1004494

    quackhandle1975 (8/14/2014)


    GilaMonster (8/12/2014)


    What are the error messages? I don’t have all of the error codes memorised.

    An expert would. 😉

    Good thing I don’t claim to be an expert then, isn’t it.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

  • quackhandle1975

    SSChampion

    Points: 11055

    GilaMonster (8/14/2014)


    quackhandle1975 (8/14/2014)


    GilaMonster (8/12/2014)


    What are the error messages? I don’t have all of the error codes memorised.

    An expert would. 😉

    Good thing I don’t claim to be an expert then, isn’t it.

    I think many on here (myself included, as I saw your presentation at Bits) see you as one. :satisfied:

    qh

    [font=»Tahoma»]Who looks outside, dreams; who looks inside, awakes. – Carl Jung.[/font]

Viewing 9 posts — 1 through 8 (of 8 total)

SQL Server Error : 948 Details

SQL Server Error: 948
Severity: 20
Event Logged or not: Yes
Description:
The database ‘%.*ls’ cannot be opened because it is version %d. This server supports version %d and earlier. A downgrade path is not supported.
Severity 20 Description:
Indicates that a statement has encountered a problem. Because the problem has affected only the current task, it is unlikely that the database itself has been damaged.

Msg 1813, Level 16, State 2, Line 4
Could not open new database ‘Database’. CREATE DATABASE is aborted.
Msg 948, Level 20, State 1, Line 4
The database ‘Database’ cannot be opened because it is version 869. This server supports version 852 and earlier. A downgrade path is not supported.

For example in simple words say

You are trying to restore/attach database/backup which been created with SQL Server 2008, but the actual version of SQL Server you are trying to attach it to is SQL Server 2005.

Now, how to fix microsoft sql server error 948 or how to solve microsoft sql server error 948? Keep reading…

Reading sql server error log location from SQL Query

Identifying SQL Server Error Log File used by SQL Server Database Engine can be done by reading SQL Server Error Logs. DBA can execute the XP_READERRORLOG extended stored procedure to read the SQL Server Error Log and search for its location used by the instance of SQL Server.

USE master
Go
xp_readerrorlog 0, 1, N'Logging SQL Server messages in file', NULL, NULL, N'asc'
Go

The parameters for XP_READERRRORLOG are:
1. Value of error log file we would like to read. values are 0 = current, 1 = last one before current, 2 = second last before current etc…
2. Log file type:- 1 or NULL = error log, 2 = SQL Agent log
3. Search string 1:- String one you want to search for
4. Search string 2:- String two you want to search for to further refine the results
5. start time for Search
6. end time for search
7. Sort order for search results:- N’asc’ = ascending, N’desc’ = descending

By default, we have 6 Server Error Logs kept but we can increase the number of SQL Server Error Logs from the default value of six.

For other ways to read and find error log location please our artcile https://sqlserver-dba.co.uk/error-log/sql-server-identify-location-of-the-sql-server-error-log-file.html

Solution for Resolving the Error

This error is expected when we try to attach file from higher version of SQL Server to lower version of SQL. We cannot attach/detach or backup/restore a database from a newer version of SQL Server down to an older version. This is because they have a different internal file structures which does not support backwards compatibility.

Here is what I was able to find on the internet.

SQL Server Version Internal Database Version
SQL Server 2016 852
SQL Server 2014 782
SQL Server 2012 706
SQL Server 2008 R2 660/661
SQL Server 2008 655
SQL Server 2005 611/612
SQL Server 2000 539
SQL Server 7 515

For more build details go to “https://sqlserverbuilds.blogspot.com/2014/01/sql-server-internal-database-versions.html”

For example in simple words say:

You are trying to restore/attach database/backup which been created with SQL Server 2008, but the actual version of SQL Server you are trying to attach it to is SQL Server 2005.

Here solution would be  : you are trying to attach a 2008 Database (655) to a 2005 instance (611); that cannot work, obviously. so solutions are:

– either update your 2005 instance to a 2008 one

– or install another instance on the same server (a 2008 one)

– or use any other server which has 2008 already installed.

Additional information:

SQL server error 948 can occur in different versions 

  1. in sql 2008 r2 error is ” sql server error 948 version 661
  2. error 948 in sql server 2008 r2
  3. in sql 2016 error is ” sql server error 948 version 852 “
  4. in sql 2012 error is ” sql server error 948 version 706 “
  5. in sql 2017 error is “ sql server error 948 version 869
  6. or simply like ” microsoft sql server 2008 r2 error 948
  7. sql server 2012 error 948,
  8. sql server 2005 error 948,

SQL Server Error Code and solution summary

SQL Server Error: 948
Severity: 20
Event Logged or not: Yes
Description:
The database ‘%.*ls’ cannot be opened because it is version %d. This server supports version %d and earlier. A downgrade path is not supported.

In short microsoft sql server error 948 solution would be to make sure database which is to be restored is of same version or lower  version than SQL Server we are trying to restore.

Вопрос:

Вчера я установил SQL Server 2008 на своем ноутбуке (Windows 7 64 бит), мне нужно подключить .mdf к серверу, но когда я попытаюсь это сделать, я получаю эту ошибку:

Не удалось привязать базу данных к серверу “принц/sqlexpress” (Microsoft.SqlServer.smo)

ДОПОЛНИТЕЛЬНАЯ ИНФОРМАЦИЯ: 1.An Исключение При выполнении инструкции Transact Sql или пакета (Microsoft.SqlServer.connectioninfo)

2.Unable для открытия физического файла Ошибка операционной системы 5: “5 (Доступ запрещен.)”. (Microsoft SQL Server, ошибка: 5120)

С помощью Интернета я нашел какое-то решение.

1. Запустите диспетчер SQL Server в качестве администратора (щелкните правой кнопкой мыши по программе, выберите “Начать как администратор”):

Но у меня все еще была такая же ошибка.

У этого .mdf файла есть разрешение, поэтому я перешел на внешний диск (pendrive, потому что у моей системы есть только диск C:, но никакого раздела я не сделал).

Затем я получил еще одну ошибку,

Не удалось привязать базу данных к серверу “ПринцSQLEXPRESS”.
(Microsoft.SqlServer.Smo) ДОПОЛНИТЕЛЬНАЯ ИНФОРМАЦИЯ:

Исключение произошло при выполнении инструкции Transact-SQL или партии. (Microsoft.SqlServer.ConnectionInfo)

База данных “Databasename” не может быть открыта, потому что это версия 655. Этот сервер поддерживает версию 611 и ранее. Путь вниз не поддерживается. Не удалось открыть новую базу данных “Databasename”. CREATE DATABASE прервана. (Microsoft SQL Server, ошибка: 948)

Я использую Query –

“select @@version;”

Я получил результат как

“Microsoft SQL Server 2005 – 9.00.3042.00 (Intel X86) 9 февраля 2007 г. 22:47:07 Copyright (c) 1988-2005 Microsoft Corporation Express Edition в Windows NT 6.1 (Build 7600:)”

что мне делать? Но я установил SQL Server 2008. Как мне это изменить? Как решить эту ошибку, пожалуйста, помогите решить эту проблему. Если у вас есть решение, отправьте его.

Лучший ответ:

Сообщение очень ясно: файл MDF базы данных имеет версию 655. Ваш сервер понимает версию 611. Это означает, что, несмотря на ваши требования об обратном, вы подключены к SQL Server 2005. Установите SQL Server 2008, подключитесь к нему и прикрепите свою базу данных. Во время процесса установки обратите внимание на выбранное имя экземпляра и убедитесь, что вы подключаетесь к этому экземпляру. Вы также можете проверить, какие экземпляры вы установили, посмотрите, какие услуги у вас есть в вашей системе. MSSQLSERVER будет экземпляром по умолчанию, MSSQL$<instancename> будет именованным экземпляром. Используйте любой инструмент запросов SCM, чтобы узнать, какие службы вы установили, например. sc.exe.

Ответ №1

Microsoft SQL Server Management Studio нуждается в правах администратора для присоединения базы данных в Windows 7. Если вы выполняете ее напрямую, чтобы получить ошибку 5120. Исправьте это выполнение значка Management Studio с помощью правой кнопки мыши и выберите выполнение как администратор. Удачи.

Ответ №2

Наконец, я решил свою проблему,

Остановите службу SQLEXPRESS и удалите все компоненты, связанные с SQL-сервером 2005. Затем откройте редактор реестра. Перейдите в HKEY_LOCAL_MACHINE – ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ – MICROSOFT – MICROSOFT SQL SERVER-DELETE папку 90. Затем снова переустановите SQL Server 2008 и создайте новый instanse для сервера 2008 года. Теперь он работает, я могу подключить файл mdf.

Понравилась статья? Поделить с друзьями:
  • Microsoft sql server ошибка 922
  • Microsoft sql server ошибка 15150
  • Microsoft sql server ошибка 15138
  • Microsoft sql server ошибка 1326
  • Microsoft sql server ошибка 1225