November 30, 2017 at 9:33 am
i cant seem to write a query to find all triggers in a database that contain the word FACTS in it
November 30, 2017 at 9:42 am
Tried this?
SELECT * FROM sys.[triggers] AS [t]
WHERE [t].[name] LIKE '$FACTS%';
November 30, 2017 at 9:42 am
When you say contain the word "FACTS", where does it contain it? In the name of the object (trigger)? The name of the table it is attached to? The word "FACTS" is in the SQL it runs?
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
November 30, 2017 at 9:47 am
Or perhaps this if you are looking for FACTS in the trigger definition.
SELECT *
FROM
[sys].[sql_modules] AS [sm]
INNER JOIN [sys].[triggers] AS [t]
ON [t].[object_id] = [sm].[object_id]
WHERE
[sm].[definition] LIKE '%FACTS%';
November 30, 2017 at 9:48 am
yes in the name of the trigger there are a lot of tables and we need a list of all triggers that contain the name FACT in the title of the trigger
November 30, 2017 at 9:50 am
My first query.
November 30, 2017 at 9:53 am
no FACTS will just be in the trigger name
November 30, 2017 at 9:54 am
myukas - Thursday, November 30, 2017 9:53 AMno FACTS will just be in the trigger name
Yes, the query will find all trigger names that contain the word FACTS. The FIRST query I posted, not the second one.
November 30, 2017 at 9:56 am
Lynn Pettis - Thursday, November 30, 2017 9:54 AMmyukas - Thursday, November 30, 2017 9:53 AMno FACTS will just be in the trigger nameYes, the query will find all trigger names that contain the word FACTS. The FIRST query I posted, not the second one.
Sorry, just noticed a typo:
SELECT OBJECT_NAME([t].[parent_id]),* FROM sys.[triggers] AS [t]
WHERE [t].[name] LIKE '%FACTS%';
November 30, 2017 at 9:56 am
thanks
November 30, 2017 at 10:07 am
when i run that against the database it returns nothing but my client says they do exist
Find the tables having Triggers starting with ‘FACTS’ and dump in excel
USALL-RS03 in GPMGlobal, CDSAllentown, CDSBasel, CDSHorsham, CDSBillingAllentown, CDSBillingBasel, CDSBillingHorsham
November 30, 2017 at 10:12 am
Here is an idea, drop the WHERE clause and visually inspect the name column.
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply