views:

16

answers:

1

I have created a SQL CLR trigger with the follow SQL:

GO
CREATE TRIGGER AuditAccountsTable
   ON [dbo].[Accounts]
   FOR INSERT,DELETE,UPDATE
AS 
EXTERNAL NAME namespace.Triggers.AuditTrigger

I am trying to query:

select * from sys.triggers

Is there a way to find the: EXTERNAL NAME namespace.Triggers.AuditTrigger on the trigger from querying in the DB?

A: 

I can't be sure as I don't have a place to test this, but does the text column returned below get you close to what you're looking for?

select t.name, c.text
    from sys.triggers t
        inner join sys.syscomments c
            on t.object_id = c.id
    where t.type_desc = 'CLR_TRIGGER'
Joe Stefanelli
This is what I am doing now as a quick fix but if I have multiple CLR Triggers, I want to be able to differentiate between them.
JohnEgbert
I had hoped that the text column from the sys.syscomments table would contain the external name you were looking for.
Joe Stefanelli