32

Are there any naming conventions for DB triggers?

For example "before delete on users" would be "bdUsers" or something like that.

Jakub Arnold
  • 83,249
  • 86
  • 225
  • 325

2 Answers2

32

For sorting reasons I would recommend a structured approach:

TR_Users_AD
TR_Users_BD
TR_OtherTable_AI

and so on.

In the end it's up to you - but whatever you choose to do, stay consistent, at least within the same database.

Tomalak
  • 322,446
  • 66
  • 504
  • 612
23

I agree with @tomalak - but i normally spell out the action at the end instead of abbreviating it...

trig_Users_delete
trig_Users_insert
trig_OtherTable_Insert
trig_OtherTable_InsteadOfInsert
Scott Ivey
  • 39,608
  • 21
  • 79
  • 117
  • 1
    While consistency is key and keys should be consistent, clarity should not be overlooked. – HPWD Jun 11 '19 at 16:01