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'
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'
相关文章推荐
- 源码调试Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
- SQL Server: Get table primary key and Foreign Key using sql query
- sql: Query to Display Foreign Key Relationships and Name of the Constraint for Each Table in Database
- How to monitor blocking in SQL Server 2005 and in SQL Server 2000 [ZT-MS]
- SQL Server: Get table primary key and Foreign Key using sql query
- PB MS SQL 2000出現10005錯誤,DBPROCESS is dead or not enabled
- How do I see all foreign keys to a table or column?
- MS SQL错误:SQL Server failed with error code 0xc0000000 to spawn a thread to process a new login or connection. Check the SQL Server error log and the Windows event logs for information about possible related problems
- mysql添加外键失败:sql 1452 Cannot add or update a child row:a foreign key constraint fails
- Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
- Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
- How to filter the ManyToManyField or ForeignKey in modelForm?
- 安装sql 2008的时候报错了 verify that you have sufficient access to that key,or conta............
- How to get details about patch applied in Oracle Applications by OAM & SQL?
- How to Get Sql sever 2000 WeekFirstDay and WeekLastDay...
- Find out all the Primary Key and Foreign Key Constraints in a table
- CodeSnip: How to Get Id of the Record Using ASP.NET and SQL Server 2000
- Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
- mysql添加外键失败:sql 1452 Cannot add or update a child row:a foreign key constraint fails
- The value of 'filter_horizontal[0]' must be a many-to-many field. The value of 'raw_id_fields[0]' must be a foreign key or a many-to-many field.