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

前端 未结 9 1859
广开言路
广开言路 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:50

    If you want to get stored procedures using specific column only, you can use try this query:

    SELECT DISTINCT Name
    FROM sys.Procedures
    WHERE object_definition(OBJECT_ID) LIKE '%CreatedDate%';
    

    If you want to get stored procedures using specific column of table, you can use below query :

    SELECT DISTINCT Name 
    FROM sys.procedures
    WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%tbl_name%'
    AND OBJECT_DEFINITION(OBJECT_ID) LIKE '%CreatedDate%';
    

提交回复
热议问题