Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Run query on tables containing a certain column
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Run query on tables containing a certain column
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01567580
Message ID:
01567580
Vues:
44
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform