34

Are there any naming conventions for DB triggers?

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

Jakub Arnold
  • 85,596
  • 89
  • 230
  • 327

2 Answers2

33

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
  • 332,285
  • 67
  • 532
  • 628
24

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
  • 40,768
  • 21
  • 80
  • 118
  • 1
    While consistency is key and keys should be consistent, clarity should not be overlooked. – HPWD Jun 11 '19 at 16:01