USE [Gaia]

SELECT 'delete from ['+c.[TABLE_SCHEMA]+'].['+c.[TABLE_NAME]+'] where '+c.[COLUMN_NAME]+'=''G00000''    ;' AS query 
FROM [INFORMATION_SCHEMA].[COLUMNS] c
WHERE [c].[TABLE_SCHEMA]='phar'
AND [c].[COLUMN_NAME] LIKE '%pharmacy_code'
;

