Risking asking something idiotic, but not easily got by Google-fu, but how to query the database id (and other information) from the base object of an synonym?
The synonym in question is an remote one (pointing to a table on another DB on the same server). The base object itself is not fixed: is the same table on different DB each execution of procedure.
I would like an non-specific method (example: don't want to rely on parsing the base_object_name
column on sys.synonyms), but I'll understand if I'm told that's the only choice.
And since it begs the question: concurrency is not an problem, only one client will call that procedure.
object_piece
is all the information I need. The and other information part is completely satisfied by your answer, @AaronBertrand. ;-)