You can't pass on database names as the parameter list. The dirty way could be that you can put a check using IF statement and then write two SQLs and fetch the results from TEST or PROD based on the parameter value.
Or alternatively you can build a dynamic SQL using the database name string from the parameter and execute it through DBC.SYSEXEC. But obviously there are limitations for dynamic SQL execution... You need to be aware of that before choosing this option.
You can't pass on database names as the parameter list. The dirty way could be that you can put a check using IF statement and then write two SQLs and fetch the results from TEST or PROD based on the parameter value.
Or alternatively you can build a dynamic SQL using the database name string from the parameter and execute it through DBC.SYSEXEC. But obviously there are limitations for dynamic SQL execution... You need to be aware of that before choosing this option.