Click here to Skip to main content
16,020,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Hi All,

In some of the machines, SQL database upgrade issue has been occurred. I can resolve this SQL database upgrade issue by using the following code,

SqlEngine engine = new SqlEngine(connecString);
engine.Upgrade();

The above mentioned error is resolved on first time running but i got following errors after second time,


"Database upgrade issue is not required. Database is already in a compatible format."


Is there any permanent solution to avoid this upgrade issue? Should i need to install any SQL packages? Please help me on this.


What I have tried:

I have tried it by using the following code,
SqlEngine engine = new SqlEngine(connecString);
engine.Upgrade();

But it is working fine first time. On second, i am getting the second mentioned error.
Posted
Updated 1-Jun-16 23:14pm
Comments
phil.o 2-Jun-16 4:43am    
That's not surprising since, when you have already updated, you don't need to do it again. You should upgrade only when it is needed. I don't know the way to determine whether upgrade has been done yet, though.

1 solution

A database upgrade imports the database file into the new version of the server, and writes a new file which is compatible with that version - the file cannot then be used with previous versions of the software, so it's very important to ensure you have good backups before you do the upgrade.
Once it's done, the new file is compatible, and doesn't need to be upgraded again, unless the database engine version is changed. That's what the message is telling you: The database has been upgraded and you don't need to do it again.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900