This example identifies values that are missing from either table instead of values that are missing from just one table. To select only items that are missing from Table_1, change the word
Full to
Left.
Find mismatched
With CTE (C1,C2) As
(
SELECT T1.Col1 As C1,T2.Col1 As C2 FROM Table_2 T2 full join Table_1 T1 On T2.Col1=T1.Col1
)
Select ISNULL(C1,C2) As Col1 from CTE where C1 Is Null Or C2 Is Null Order By ISNULL(C1,C2)
Results
Col1
E
F
Create test data
CREATE TABLE [dbo].[Table_1](
[col1] [nchar](10) NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Table_2](
[col1] [nchar](10) NULL
) ON [PRIMARY]
GO
insert into table_1 values ('A');
insert into table_1 values ('B');
insert into table_1 values ('C');
insert into table_1 values ('D');
insert into table_1 values ('F');
insert into table_2 values ('A');
insert into table_2 values ('B');
insert into table_2 values ('C');
insert into table_2 values ('D');
insert into table_2 values ('E');