I've been using the SQL found here: Find all tables containing column with specified name
to great success. It allows me to find all tables that contain a certain column. My issue is that the database I'm working on seems to have a lot of empty tables (maybe around half of my results are empties). I was wondering if there was a way to modify the code in the link such that empty rows/columns are not presented.Below is the code from the link:
SELECT c.name AS 'ColumnName'
,t.name AS 'TableName'
FROM sys.columns c
JOIN sys.tables t ON c.object_id = t.object_id
WHERE c.name LIKE '%MyName%'
ORDER BY TableName
,ColumnName;
Thank you,