Where does SQL Server store the stored procedure code?

前端 未结 7 1279
情书的邮戳
情书的邮戳 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:31

    You can use

    select object_definition(object_id(routine_name)) from information_schema.routines
    

    or

    select object_definition(object_id) from sys.objects where name = 'foo'
    

    or even

    select object_definition(object_id('foo')); -- 'foo' is the table name
    

    These versions are never truncated.

提交回复
热议问题