How can I list all the triggers of a database in sqlite?
Asked Answered
T

1

27

I can not drop a trigger, but when I try to create a new one with same name — it alerts me that trigger exists. So, I want to list all the triggers, to figure out what's wrong.

Tremblay answered 6/9, 2013 at 10:0 Comment(0)
W
60

You can get all of the data relating to triggers using the sqlite_master table (this includes the ddl code to create them). If you don't want all of the data just leave off some of the columns in your query.

For all data:

select * from sqlite_master where type = 'trigger';

For just a list of names:

select name from sqlite_master where type = 'trigger';
Willamina answered 6/9, 2013 at 11:41 Comment(1)
For those who, like me, do/did not know what sqlite_master is, see this link.Employ

© 2022 - 2024 — McMap. All rights reserved.