question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQL Server: Set operations should work if normalized store type is the same

See original GitHub issue

In SelectExpression.cs:1594 (Microsoft.EntityFrameworkCore.Query.SqlExpression) there is code that does

if (innerColumn1.TypeMapping!.StoreType != innerColumn2.TypeMapping!.StoreType)
{
    throw new InvalidOperationException(RelationalStrings.SetOperationsOnDifferentStoreTypes);
}

If col1 type in mode is VARCHAR(20) and col2 type is varchar(20) it throws. This should not happen as SQL server is not case sensitive. I udestrand why it would be desirable for varchar(20) and varchar(50) to throw, but in case of case sensitivity it’s exactly the same type.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rojicommented, Sep 11, 2022

I wonder if we should have a way to normalize store types, yielding their canonical representation which can be compared…

0reactions
ajcvickerscommented, Mar 16, 2023

Note from triage: since the VisitSqlParameter check is an optimization only, the existing check is fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Database Normalization in SQL Server?
The process of taking a database design, and apply a set of formal criteria and rules, is called Normal Forms. The database normalization...
Read more >
Data type normalization vs. query performance
1 Answer 1 ... Ideally, you should keep a highly normalized operational database for inserts, updates, and deletes, to minimize duplication and ...
Read more >
Database Normalization Causing Inefficiency
I'm using the most recent version of MariaDB [...] 10.0.31-MariaDB-0ubuntu0.16.04.2. That's not at all the "most recent version".
Read more >
Normalization in SQL | 1NF, 2NF, 3NF and BCNF in Database
This article on Normalization in SQL will help you to learn how to reduce the redundancy of data and decrease the anomalies of...
Read more >
Demystifying Cache Normalization
When we perform operations, Apollo Client normalizes the response data before saving it to the cache. From the docs on Data Normalization, the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found