I want to return all tables (or column names but the table itself is sufficient) that contain a certain string.
Right now I can list all column names = to something, but I don't know if I can find by value within the column.
SELECT t.name,
t.type_desc
FROM dbo.[bigdatabase].sys.columns AS c
INNER JOIN sys.tables AS t
ON c.object_id = t.object_id
WHERE c.name = 'Language_name'
Basically, I'm working with a huge database with a terrible data dictionary and terrible naming conventions. For this example, I have a query that finds the language someone speaks in the 'person' table from the 'Language_name' column. The 'Language_name' column returns a uniqueidentifier instead of the actual language name. I can't find the foreign key where the master would be to show what language this code translates to. I figure if I could search the database for columns this uniqueidentifier is also in I can find the master.