How to view a stored function - SQL Server

后端 未结 7 2393
陌清茗
陌清茗 2020-12-28 17:03

Version: SQLServer 8

I would like to view the contents of a stored function in sqlserver, i.e. what exactly the function is doing.

None of the options listed

相关标签:
7条回答
  • 2020-12-28 17:54
    --ShowStoredProcedures
    select p.[type]
          ,p.[name]
          ,c.[definition]
      from sys.objects p
      join sys.sql_modules c
        on p.object_id = c.object_id
     where p.[type] = 'P'
       --and c.[definition] like '%foo%'
    ORDER BY p.[name]
    ___________
    
    SELECT OBJECT_NAME(object_id) ProcedureName,
           definition
    FROM sys.sql_modules
    WHERE objectproperty(object_id,'IsProcedure') = 1
    ORDER BY OBJECT_NAME(object_id)
    
    0 讨论(0)
提交回复
热议问题