Below query gives me list of tableid which are present in DBC.ACCESSRIGHTS but doesnt exist in DBC.TVM thus ideal candidate to be taken off from DBC.ACCESSRIGHTS. But i need to figure out the users from DBC.ALLRIGHTS with access on these 'not existing' objects so as to notify them but not getting the way for it .Any help is welcome.
SELECT AR.* FROM DBC.ACCESSRIGHTS AR WHERE AR.TVMID <> '000001000000'xb AND AR.TVMID NOT IN (SEL TVMId FROM DBC.TVM)
Note: Isn't the entry in DBC.ACCESSRIGHTS be automatically deleted on object deletion?