|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Which table launched the triggerHi everyone,
Is there some way to know the name of the table that launched a trigger, within the same trigger? I'm trying to create code I can use with several tables without having to modify it Thanks in advance Eduardo Martinez O. Eduardo Martinez wrote:
> Hi everyone, You already have to create separate versions of the triggers for each > > Is there some way to know the name of the table that launched a > trigger, within the same trigger? > > I'm trying to create code I can use with several tables without > having to modify it > > Thanks in advance > > Eduardo Martinez O. table. At that point, you're better off putting the table name directly in the trigger. That's my recommendation. Another option might be to use the @@PROCID variable along with OBJECT_NAME(). If you code your triggers in a well-defined manner, you can probably pull the table name from the trigger name. But I think that adds uncertainty and added overhead to the trigger. Thanks a lot, yes it seems the best option is to code the table's name
directly in the trigger, Best regards Eduardo Martinez O. Show quote "David Gugick" <davidg-nospam@imceda.com> escribió en el mensaje news:O$BS2S%23VFHA.3280@TK2MSFTNGP09.phx.gbl... > You already have to create separate versions of the triggers for each > table. At that point, you're better off putting the table name directly > in the trigger. That's my recommendation. Another option might be to use > the @@PROCID variable along with OBJECT_NAME(). If you code your > triggers in a well-defined manner, you can probably pull the table name > from the trigger name. But I think that adds uncertainty and added > overhead to the trigger. > > -- > David Gugick > Imceda Software > www.imceda.com > |
|||||||||||||||||||||||