You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a server running SQL Server 2022, but the database has a compatibility level 110 due to my legacy system. I am developing a new system and planning to upgrade to EF Core 8 with .NET 8.0.
Currently, I am fetching data from the database using this configuration:
options.UseSqlServer("<connection_string>", o => o.UseCompatibilityLevel(120));
It seems to be working so far, but I am concerned if this is a safe approach. Specifically:
The SQL Server instance is running 2022, but with compatibility level 110 (SQL Server 2012).
Will this work reliably with EF Core 8?
Is it risky to set the compatibility level to 120 while the database is still on compatibility level 110?
I cannot make changes to the legacy system or its database.
I would appreciate your insights into whether this approach could lead to issues or if there's anything I need to watch out for.
Thanks!
Your code
`options.UseSqlServer("<connection_string>", o =>o.UseCompatibilityLevel(120));
`
Stack traces
Verbose output
EF Core version
8.0.0
Database provider
No response
Target framework
.NET 8.0
Operating system
No response
IDE
No response
The text was updated successfully, but these errors were encountered:
Is it risky to set the compatibility level to 120 while the database is still on compatibility level 110? - No
Why would you set the compatibility level to something that's higher than what your database is actually configured to support? Here I'll actually disagree with @ErikEJ - the whole point of EF's compatibility level setting is to tell EF that it can generate SQL that will only work starting with that compatibility level. So I'm not sure if there's specifically something EF generates that works on 120 but not on 110, but there could be. Why not simply set the compatibility level to the right value?
Question
Hello,
I have a server running SQL Server 2022, but the database has a compatibility level 110 due to my legacy system. I am developing a new system and planning to upgrade to EF Core 8 with .NET 8.0.
Currently, I am fetching data from the database using this configuration:
options.UseSqlServer("<connection_string>", o => o.UseCompatibilityLevel(120));
It seems to be working so far, but I am concerned if this is a safe approach. Specifically:
I would appreciate your insights into whether this approach could lead to issues or if there's anything I need to watch out for.
Thanks!
Your code
Stack traces
Verbose output
EF Core version
8.0.0
Database provider
No response
Target framework
.NET 8.0
Operating system
No response
IDE
No response
The text was updated successfully, but these errors were encountered: