If we have code in an SP Database1 then queries Database2 (on the same server) we want the same code to work on the databases Database1Dev and Database2Dev. But this currently means editing the full SP each time we push to Live.
We want a single of line of code such as
select col1, col2 from databaseName..ourTable
Where databaseName is somehow set at a server level.
I understand synonyms are the wrong solution for this. Is there something similar we can use that doesn't include writing a synonym for every single object?