1. Should the parameters (@db + @server) act as constants/config values, where setup once / use many is applicable per each server or that per each query you need to deduct the values from a table?
2. Is it a closed list or that new values might come up from time to time?
There are basically 2 available solutions:
1. Concatenation of strings and then executing them as OPENQUERY or OPENROWSET
2. Using synonyms, but that requires some more details from you