Hi all, sorry for the vague title, I need to remove *some* records from all tables that have a column called e.g "MyColumn" , my criteria is - if the tables column has a value that matches one in a lookup table then I want to remove them. So I need to get a list of all the tables that have this *column* - then remove records that match my lookup table. I found this code which lists all the tables but I don't know how to proceed from here :-(
SELECT COLUMN_NAME, TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME LIKE '%MyName%'
any ideas ?
Regards,
Peter J. Kane
Pete