database - Trigger on db1.table1 fails immediately fails when it references db2.table2 -
i working system (i not developer) uses half dozen databases, on same sybase ase 15.7 server.
the 2 important databases need access transactions , configuration. both updated in real-time, , in real-time can capture data want. here's super-simplified example of trigger:
use transactions go create trigger mytrigger on userlog insert begin -- -- stuff here within transaction database, no problems. -- ....... -- now, try access configuration database, , boom, fails insert mylog (somedata) select userdata configuration.dbo.userconfiguration ...blah... end my trigger fails when table referenced outside of transactions database, not @ other time.
btw, i'm logged in systems admin when create trigger.
as noted in sybase documentation, triggers part of transactions , if serious error occurs in trigger, transaction rolled back. see occurring.
i suspect error due 1 of 3 possible causes:
- security grants tables in 'other' database kind
- security-limitation configured @ time database built
- a sybase restriction cannot overcome
regarding #1, i've granted select public , 'dbo' on userconfiguration table. dbo user creating userlog in transactions. i'm not sure grant applying correctly since every user scoped specific database, not global user.
regarding #2, can't figure out if there possible limitations configured in, , not overcome.
regarding #3, sybase documentation states trigger should able reference tables in other databases.
lastly, since cannot see error being raised or trap it, have nothing go on tackle problem. don't want insert own records monitored table because it's not table. i've hunted around kind of error log don't see such thing. there one? i've researched trying set equivalent of try-catch blocks, blocks prevent error bubbling up, sybase appears not have such controls.
does have ideas how might progress forward here?
my trigger going populate table of own in real-time , needs select 'inserted' object, , tables in 2 databases.
Comments
Post a Comment