'Downgrade SQL database to the client sql server version
I've create a desktop app in C# win Form after publish it it's work just fine in my system but when installed in the client system it shows this error message
the database 'database path\database.mdf' cannot be opened because it is version 904, This server supports 782 and earlier, A downgrade path is not supported.
I tried to change the compatibility level to 100 which what SQL server 2008 support and rebuild the the app and check if the database has really changed the level to 100 and it does so after republish still shows the same error.
So is there a proper way to downgrade the database or make a second copy that the system choose what its compatible with?
note : I create the database with SQL Server 2019 which a Level 150 the client Has a windows 7 laptop and only SQL Server 2014 and earlier can be installed.
Solution 1:[1]
You can create a script for your database and define the server this script should target. New database script will create the database.mdf file compatible with client.
Here are the steps.
- Right click on your Database and select
Tasks > Generate Scripts...
- Click "Next" and then "Advanced"
- From "Script for Server Version" dropdown select your desired server
- A script for that version of sql Database will be generated and save at given directory. You can run that script on your end to create an mdf and share with client to use as localDB or simply run the script on client's instance
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Bilal Bin Zia |



