set a parameter with multiple values and those values would be name of database.
based on the name of database you get from your parameter, connect to each of your table to that DB, your SP will be a dynamic SP
e.g.
Create Proc GetValies(@DB as Nvarchar(50))
As
BEGIN
Declare @SQL Nvarchar(max)
set @SQL='select * from '+@DB+'.dbo.TableName'
exec Sp_Execute @SQL
END