Search for All the Stored Procedures Name that have a specific column

-- For All Objects

SELECT  OBJECT_NAME(object_id) ,
        definition
FROM    sys.sql_modules
WHERE   definition LIKE '%' + 'PhaseID' + '%'


-- For Stored procedures only

SELECT DISTINCT
        OBJECT_NAME(object_id) ,
        OBJECT_DEFINITION(object_id)
FROM    sys.procedures
WHERE   OBJECT_DEFINITION(object_id) LIKE '%' + 'PhaseID' + '%'

Comments

Popular posts from this blog

Grouping Sets, With Rollup and With Cube example

Adding Page brake aganist group values

To Get All the Names of tables and Databases their data have changed in last 24 Hours And Backup those databases