SqlServer:
select name from sysobjects where xtype='TR' --所有触发器
select name from sysobjects where xtype='P' --所有存储过程
select name from sysobjects where xtype='V' --所有视图
select name from sysobjects where xtype='U' --所有表
Oracle:
Select object_name From user_objects Where object_type='TRIGGER'; --所有触发器
Select object_name From user_objects Where object_type='PROCEDURE'; --所有存储过程
Select object_name From user_objects Where object_type='VIEW'; --所有视图
Select object_name From user_objects Where object_type='TABLE'; --所有表
本文提供了在SqlServer和Oracle数据库中查询触发器、存储过程、视图及表的SQL语句。针对不同数据库类型,展示了如何使用sysobjects和user_objects表来获取所需对象的名称。
7697

被折叠的 条评论
为什么被折叠?



