欢迎投稿

今日深度:

SQL Server根据表名查询存储过程或试图,

SQL Server根据表名查询存储过程或试图,


select a.name 来源名称,b.text 代码内容,
    case
        when a.xtype='V' then '视图'
        when a.xtype='P' then '存储过程'
        when a.xtype='FN' then '标量函数'
        when a.xtype='TF' then '表函数'
        when a.xtype='TR' then '触发器'
        else a.xtype
    end 类型
from sysobjects a inner join syscomments b on a.ID=b.ID
where b.text like '%需要查询的表%'
order by 类型

 

www.htsjk.Com true http://www.htsjk.com/Sql_Server/43152.html NewsArticle SQL Server根据表名查询存储过程或试图, select a.name 来源名称,b. text 代码内容, case when a.xtype = ' V ' then ' 视图 ' when a.xtype = ' P ' then ' 存储过程 ' when a.xtype = ' FN ' then ' 标量函数 ' when a.xt...
相关文章
    暂无相关文章
评论暂时关闭