Vedere tutti i triggers di un db

lunedì 22 ottobre 2007 - 09.49

bluland Profilo | Guru

salve,

uso SQL server 2000 e' possibile vedere tutti i triggers associati ad un db?


ops ho sbagliato stanza!!

saluti
--------------------
Vincenzo PESANTE
System Engineer

micto27 Profilo | Senior Member

>salve,
>
>uso SQL server 2000 e' possibile vedere tutti i triggers associati
>ad un db?
>
>
>ops ho sbagliato stanza!!
>
>saluti

Se vuoi solo l'elenco può bastare

SELECT triggers.name AS trigger_name, triggers.type, tables.name AS table_name
FROM sysobjects triggers INNER JOIN
sysobjects tables ON triggers.parent_obj = tables.id
WHERE (triggers.type = 'TR')

se invece vuoi vedere anche il codice T-SQL associato ai vari triggers

SELECT triggers.name AS trigger_name, triggers.type, tables.name AS table_name, syscomments.text AS [sql]
FROM sysobjects triggers INNER JOIN
sysobjects tables ON triggers.parent_obj = tables.id INNER JOIN
syscomments ON triggers.id = syscomments.id
WHERE (triggers.type = 'TR')

ciao, Michele
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5