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
The exact error is "Unable to translate set operation when matching columns on both sides have different store types." but this happens because the generated SQL for the 2 queries has a different column count, it generates the following:
SELECT [a].[UserName] AS [Name]
FROM [AspNetUsers] AS [a]
WHERE (@__search_0 LIKE N'') OR (CHARINDEX(@__search_0, [a].[UserName]) >0)
UNION ALLSELECT [a0].[Id] AS [ID], [a0].[Name]
FROM [AspNetRoles] AS [a0]
WHERE (@__search_0 LIKE N'') OR (CHARINDEX(@__search_0, [a0].[Name]) >0)
Which SQL server fails on. To work around this I am just selecting 2 different properties as the working query and then changing the value in memory.
The text was updated successfully, but these errors were encountered:
I'm not convinced this is the same issue? Those issues seem related to the types of the data and the SQL column types. In the case I posted all columns are simply nvarchar(max) and all properties are string.
The only failing part is the generated SQL selects 1 column union 2 columns which sql can't do, that isn't a type of data issue but a query generation issue itself.
Given this object:
The following query works (all properties are strings):
However it fails if we change the 3rd line to use the
UserName
property for both the ID and Name properties like so:The exact error is "Unable to translate set operation when matching columns on both sides have different store types." but this happens because the generated SQL for the 2 queries has a different column count, it generates the following:
Which SQL server fails on. To work around this I am just selecting 2 different properties as the working query and then changing the value in memory.
The text was updated successfully, but these errors were encountered: