In the LEFT JOIN condition you need to make sure that both columns are nvarchar so you need to do cast([v_FullCollectionMembership].CollectionID as nvarchar(30)) = cast([v_Collections].CollectionID as nvarchar(30)) The query will be slower with that, but should work.
SQL conversion fail nvarchar to int
Hello, I am working on the following query - SELECT DISTINCT [CM_TAN].[dbo].[v_FullCollectionMembership].[Name] AS Asset, [CM_TAN].[dbo].[v_Collections].CollectionName AS Collection_Name FROM [CM_TAN].[dbo].[v_FullCollectionMembership]LEFT JOIN [CM_TAN].[dbo].[v_Collections] ON [CM_TAN].[dbo].[v_FullCollectionMembership].CollectionID = [CM_TAN].[dbo].[v_Collections].CollectionID Order By Asset DESC I am getting this error - Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the nvarchar value 'SMS00001' to data type int. I know why but I am not sure how to fix it. It is probably simple for someone with a better understanding of SQL then I have.