Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run query on tables containing a certain column
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Run query on tables containing a certain column
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01567580
Message ID:
01567580
Views:
43
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
Next
Reply
Map
View

Click here to load this message in the networking platform