Installing MSSQL for Windows 7 and running application made with MSSQL2016 for X86 systems

I'm developing an ERP via Windows Form Application using (C# and SQL) through Visual Studio 2017 and MSSQL SERVER 2016 (VERSION 852) on a 64 bit Machine with Windows 8.

On deploying the application on the X64 machine with SQLLOCALDB (VERSION 852 or above) installed, the application is working fine.

But, I want to distribute the application in my circles having old machines with X86 (32 bit) architecture. The application is getting installed, but on launching the application, the form with DATABASE CONNECTIVITY is creating a problem.

"The database 'MyFirstWFAAPP' cannot be opened because it is version 852. This server supports version 851 and earlier. A downgrade path is not supported. Could not open new database 'MyFirstWFAAPP'. CREATE DATABASE is aborted. Cannot attach the file 'C:\devx\2018\MyFirstWFAAPP\App_Data\MyFirstWFAAPP.mdf' as database 'MyFirstWFAAPP'. "

PS: Installation of MSSQL SERVER (Local DB) to 32 bit machines, WINDOW 7, has been deprecated by Microsoft (As I've been informed) So, MSSQL SERVER 2016 and above cannot be installed onto Window 7 systems. Window 7, XP Support SQL SERVER installation either or below SQL SERVER 2008 R2 (VERSION 660/661).

I'm in a dilemma, as I'm have no idea of what to do.

1) Is there any way, we can convert Code of SQL SERVER 2016 to SQL SERVER 2008 (R2) or below??

2) or, should I delete the MSSQL Server 2016 and then install the 2008 editions.

3) or, should I install SQL 2008 on the parallel with SQL SERVER 2016 running. and, also install MSSQL Server Management Studio and choose the targeted versions of MSSQL. (I'm not sure, whether it's possible. Just guessing).

Please support. As, I'm worried.

Thanks and Regards! Narayan

1 answer

  • answered 2018-02-21 06:40 Remus Rusanu

    This has nothing to do with the target platform (x86 vs. x64). This is simply an issue of targeted SQL Server version. SQL Server knows how to upgrade a database file, but there is absolutely no way it can downgrade one. You are distributing a SQL Server 2016 database file (internal version 852), this will only be opened by the SQL Server 2016 or SQL Server 2017.

    But the real problem is different. The real problem is that you are distributing the database as an artifact. This is an absolute NO. Just think how will you distribute the next version of your app, your MDF will replace the actual data that was updated by your 'circles'. You must change your application to distribute only scripts for creating and upgrating database. Your framework of choice may well already provide a solution.