Created
November 7, 2024 14:15
-
-
Save pferreirafabricio/332cc5305a5ba77255857ac446abddab to your computer and use it in GitHub Desktop.
🎲 A select query to get queries inside a SQL Server database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
t.name AS TriggerName, | |
o.name AS TableName, | |
t.type_desc AS TriggerType, | |
m.definition AS TriggerDefinition | |
FROM | |
sys.triggers t | |
INNER JOIN | |
sys.objects o ON t.parent_id = o.object_id | |
INNER JOIN | |
sys.sql_modules m ON t.object_id = m.object_id | |
WHERE | |
o.type = 'U' | |
AND m.definition LIKE '%xyz%' | |
ORDER BY | |
o.name, t.name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment