I have 2 DB's, Building and Contact, and a stored proc that executes from the Building DB, building_sp.
building_sp needs to update a table, TblContact, within Contact, and they way I have been referencing it is by
[Contact].dbo.[TblContact]
Since the Contact table can be named arbitrarily, I need to remove this dependency.
The options NOT available to me are
- Moving the stored proc logic to code (ie a .NET controller, where the Contact DB name could be set in a web service config file).
- Storing the Contact DB name in a meta table/row in the Building DB.
- Pass in the a string variable containing the Contact DB name into the building_sp.
Any suggestions or help on this will be appreciated, even just rough ideas or partial answers. Thanks.