您的位置:首页 > 数据库

About MS Sql 2000,to get all triggers or foreign key constraints.

2007-03-28 22:18 567 查看
Get trigger status to know if trigger is disabled or not.

use pubs
go
--trigger name: employee_insupd
SELECT OBJECTPROPERTY(OBJECT_ID('employee_insupd'),N'ExecIsTriggerDisableD') as IsTriggerDisabled

To get all triggers of current database

use pubs
go
select a.name as tableName,b.id as triggerObjectId,b.name as triggerName from sysobjects a
join sysobjects b on a.id=b.parent_obj
where a.type='u' and
b.xtype='tr'

also you can get all foreign key by changed the last clause to b.xtype='f'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐