-- Read-only contextIsKey dependency discovery for SQL Server
DECLARE @column_name sysname = N'customer_id';

SELECT
    SCHEMA_NAME(o.schema_id) AS schema_name,
    o.name AS object_name,
    o.type_desc AS object_type,
    m.definition
FROM sys.sql_modules AS m
JOIN sys.objects AS o ON o.object_id = m.object_id
WHERE m.definition LIKE N'%' + @column_name + N'%'
ORDER BY schema_name, object_name;
