How to find tables in which specific column not exists.
E.g column ID
not present in table Contact
, then Contact
table will be in result set.
I tried:
SELECT DISTINCT t.name
FROM sys.tables t
INNER join sys.columns C ON c.object_id = t.object_id
WHERE c.name <> 'ID'
But above query return all table for which column ID
is present in it.