如何在数据库中查询出所有有触发器的表,求代码和说明?

[复制链接]
查看11 | 回复3 | 2015-7-4 07:21:26 | 显示全部楼层 |阅读模式
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' --所有表 全部禁用:Alter table t1 disable trigger all;全部生效:Alter table t1 enable trigger all;单个禁用:Alter table t1 disable trigg...
回复

使用道具 举报

千问 | 2015-7-4 07:21:26 | 显示全部楼层
select name 表格名称 from sysobjects where xtype='U'AND id in(select parent_obj from sysobjects where xtype='TR')------查询有触发器的表select name 表格名称 from sysobjects where xtype='U'A...
回复

使用道具 举报

千问 | 2015-7-4 07:21:26 | 显示全部楼层
Oracle数据库的话:SQL> SELECT2
trigger_name,3
status4FROM5
user_triggers6WHERE7
table_name='TEST_TRIGGER_TABLE';TRIGGER_NAME
...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行