Find all stored procedures that reference a specific column in some table

前端 未结 9 1871
广开言路
广开言路 2021-01-30 16:01

I have a value in a table that was changed unexpectedly. The column in question is CreatedDate: this is set when my item is created, but it\'s being changed by a st

9条回答
  •  遇见更好的自我
    2021-01-30 16:59

    i had the same problem and i found that Microsoft has a systable that shows dependencies.

    SELECT 
        referenced_id
        , referenced_entity_name AS table_name
        , referenced_minor_name as column_name
        , is_all_columns_found
    FROM sys.dm_sql_referenced_entities ('dbo.Proc1', 'OBJECT'); 
    

    And this works with both Views and Triggers.

提交回复
热议问题