I created a trigger for a table in SQL Server and it works for me.
My problem is: How do find it and modify it?
I use this query to find my triggers
select t.name as TriggerName,m.definition,is_disabled
from sys.all_sql_modules m
inner join
sys.triggers t
on m.object_id = t.object_id
inner join sys.objects o
on o.object_id = t.parent_id
Where o.name = 'YourTableName'
This will give you all triggers on a Specified Table
With this query you can find all Trigger in all tables and all views.
;WITH
TableTrigger
AS
(
Select
Object_Kind = 'Table',
Sys.Tables.Name As TableOrView_Name ,
Sys.Tables.Object_Id As Table_Object_Id ,
Sys.Triggers.Name As Trigger_Name,
Sys.Triggers.Object_Id As Trigger_Object_Id
From Sys.Tables
INNER Join Sys.Triggers On ( Sys.Triggers.Parent_id = Sys.Tables.Object_Id )
Where ( Sys.Tables.Is_MS_Shipped = 0 )
),
ViewTrigger
AS
(
Select
Object_Kind = 'View',
Sys.Views.Name As TableOrView_Name ,
Sys.Views.Object_Id As TableOrView_Object_Id ,
Sys.Triggers.Name As Trigger_Name,
Sys.Triggers.Object_Id As Trigger_Object_Id
From Sys.Views
INNER Join Sys.Triggers On ( Sys.Triggers.Parent_id = Sys.Views.Object_Id )
Where ( Sys.Views.Is_MS_Shipped = 0 )
),
AllObject
AS
(
SELECT * FROM TableTrigger
Union ALL
SELECT * FROM ViewTrigger
)
Select
*
From AllObject
Order By Object_Kind, Table_Object_Id
select m.definition from sys.all_sql_modules m inner join sys.triggers t
on m.object_id = t.object_id
Here just copy the definition and alter the trigger.
Else you can just goto SSMS and Expand the your DB and under Programmability expand Database Triggeres then right click on the specific trigger and click modify there also you can change.
select * from information_schema.TRIGGERS;
This might be useful
SELECT
t.name AS TableName,
tr.name AS TriggerName
FROM sys.triggers tr
INNER JOIN sys.tables t ON t.object_id = tr.parent_id
WHERE
t.name in ('TABLE_NAME(S)_GOES_HERE');
This way you just have to plugin the name of tables and the query will fetch all the triggers you need
Much simple query below
select (select [name] from sys.tables where [object_id] = tr.parent_id ) as TableName ,* from sys.triggers tr