Is it possible to search all tables in a DB for a certain value in a column? I have 30 tables in my DB. Not all of them are using the FK employee_no. Out of all the tables that do contain an employee_no column, not all tables will have a record entered for every employee.
I would like to get a list of all the tables that contain the value 6172817 for the employee_no column.
I know
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME like '%employee_no'
will return all the tables with the column name employee_no, but now I want all the tables with the value 6172817 for employee_No
I have tried
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE employee_no like '%6172817'
Is this possible?