我在哪裏可以找到構建在數據庫上的觸發器的位置,我在Google上搜索過,但無法獲得任何結果。SQL server 2008 r2觸發位置
我的觸發腳本是:
CREATE TRIGGER [log]
ON DATABASE
FOR DDL_DATABASE_LEVEL_EVENTS
AS
DECLARE @data XML
SET @data = EVENTDATA()
....
....
我在哪裏可以找到構建在數據庫上的觸發器的位置,我在Google上搜索過,但無法獲得任何結果。SQL server 2008 r2觸發位置
我的觸發腳本是:
CREATE TRIGGER [log]
ON DATABASE
FOR DDL_DATABASE_LEVEL_EVENTS
AS
DECLARE @data XML
SET @data = EVENTDATA()
....
....
要一一列舉:
SELECT
sysobjects.name AS trigger_name
,USER_NAME(sysobjects.uid) AS trigger_owner
,s.name AS table_schema
,OBJECT_NAME(parent_obj) AS table_name
,OBJECTPROPERTY(id, 'ExecIsUpdateTrigger') AS isupdate
,OBJECTPROPERTY(id, 'ExecIsDeleteTrigger') AS isdelete
,OBJECTPROPERTY(id, 'ExecIsInsertTrigger') AS isinsert
,OBJECTPROPERTY(id, 'ExecIsAfterTrigger') AS isafter
,OBJECTPROPERTY(id, 'ExecIsInsteadOfTrigger') AS isinsteadof
,OBJECTPROPERTY(id, 'ExecIsTriggerDisabled') AS [disabled]
FROM sysobjects
INNER JOIN sysusers
ON sysobjects.uid = sysusers.uid
INNER JOIN sys.tables t
ON sysobjects.parent_obj = t.object_id
INNER JOIN sys.schemas s
ON t.schema_id = s.schema_id
WHERE sysobjects.type = 'TR'
來源:Need to list all triggers in SQL Server database with table name and table's schema
要查看他們:
來源:Can't see the triggers that i created in sql server management studio 2008
你說的*觸發器的位置意味着*? – 2014-11-06 08:14:21
如果你的意思是,我在哪裏可以找到SSMS的「對象瀏覽器」上的Tigger? – Mithrandir 2014-11-06 08:18:36
是的,我的意思是。 – Ibra 2014-11-06 09:28:56