select a.name 来源名称,b.text 代码内容, case when a.xtype="V" then "视图" when a.xtype="P" then "存储
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 类型
--结束END--
本文标题: SQL Server根据表名查询存储过程或试图 - Hero
本文链接: https://www.lsjlt.com/news/6793.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-04-19
2024-04-19
2024-04-19
2024-04-19
2024-04-19
2024-04-19
2024-04-19
2024-04-19
2024-04-19
2024-04-19
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0