I have two tables, target and source. Somehow data in the target table is wrongly calculated and I want to see which data is not the same as in the source table.

For example I have target table T here I have columns

```
BetSlipId int, ExternalId int, IsValid bit 

```

In source table S i have 

```
BetSlipId int, ExternalId int, Invalid bit

```

isValid in target is calculated as ~ ISNULL(S.Invalid,0)

How can I find out which `isValid` flag is different for `ExternalId` in my target table?

```
select FSBT.ExternalSettleId
FROM #FSBTempTable FSBT
join IGP.SportsbookManagement.Settle S on s.ExternalSettleId= fsbt.ExternalSettleId
where FSBT.IsValid <> ~ S.Invalid

```

Here is an example only for non null values