locked
Getting Error in opening .mdf Database in asp.net application RRS feed

  • Question

  • User-2055169795 posted

    Hello,
    I am getting this error while accessing database.
    The database 'E:\WORKSPACE\xxx\xxx\APP_DATA\xxxxxxxxxx.MDF' cannot be opened because it is version 852. This server supports version 782 and earlier. A downgrade path is not supported.Could not open new database.

    Actually, I have copied the complete solution from one system to other and trying to run it but getting the above error. All DLL and all References are added correctly.
    I also installed SQL Server 2017 Express Edition on my system still setting the error.

    Please guide me to the solution for this.

    Thanks,
    Ashwin

    Monday, January 21, 2019 12:18 PM

All replies

  • User753101303 posted

    Hi,

    According to http://sqlserverbuilds.blogspot.com/2014/01/sql-server-internal-database-versions.html, 782 is SQL Server 2014 and 852 is SQL Server 2016.

    More likely you have multiple instances of SQL Server. Make 100% sure to use the correct one (you can see them using services.msc). If using SQL Server 2017 your file will be upgraded (which may not what you want if the production server uses SQL Server 2016).

    IMHO if you can make sure to use the same SQL Server version that will be available on the production machine to avoid last minute surprises...

    Monday, January 21, 2019 12:38 PM
  • User36583972 posted


    Hi ashwin,

    Hello,
    I am getting this error while accessing database.
    The database 'E:\WORKSPACE\xxx\xxx\APP_DATA\xxxxxxxxxx.MDF' cannot be opened because it is version 852. This server supports version 782 and earlier. A downgrade path is not supported.Could not open new database.

    Actually, I have copied the complete solution from one system to other and trying to run it but getting the above error. All DLL and all References are added correctly.
    I also installed SQL Server 2017 Express Edition on my system still setting the error.

    Please guide me to the solution for this.

    Thanks,
    Ashwin

    As far as I know, you cannot attach/detach or backup/restore a database from a newer version of SQL Server down to an older version - the internal file structures are just too different to support backwards compatibility. Obviously, your database is from a SQL Server 2016(852) while the engine you're trying to attach it to is SQL Server 2014 (internal version: 782).

    You can try the following suggestions.

    1: using the same version of SQL Server on all your machines

    2: Creating the database scripts for both structure (tables, view, stored procedures etc.) and for contents (the actual data contained in the tables) either in SQL Server Management Studio (Tasks > Generate Scripts)

    3: Using a third-party tool compare to do "diffing" between your source and target, generate update scripts from those differences, and then execute those scripts on the target platform; this works across different SQL Server versions.

    For more detailed: The database cannot be opened because it is version 851. This server supports version 782 and earlier. A downgrade path is not supported

    Best Regards,

    Yong Lu

    Tuesday, January 22, 2019 2:27 AM