Where does SQL Server store the stored procedure code?

前端 未结 7 1208
情书的邮戳
情书的邮戳 2020-12-25 13:11

I once needed the lines of the stored procedures to be able to trace whether I have a reference to some function, procedure or table, or sometimes to try to find something i

相关标签:
7条回答
  • 2020-12-25 13:36

    It stored it inside the system schema tables:

    SELECT * FROM INFORMATION_SCHEMA.ROUTINES
    

    See MSDN about the INFORMATION_SCHEMA.ROUTINES view:

    ms-help://MS.SQLCC.v10/MS.SQLSVR.v10.en/s10de_6tsql/html/c75561b2-c9a1-48a1-9afa-a5896b6454cf.htm
    

    For a content search on this, you can do the follwing:

    SELECT * FROM INFORMATION_SCHEMA.ROUTINES
    WHERE ROUTINE_DEFINITION LIKE '%search_string%'
    
    0 讨论(0)
提交回复
热议问题