Thanks all for replies. Based on our replies I get the idea that I did not explain what I am facing correctly.
Let's say I have a server A on which I have database customers and database orders. Some of my queries will have joins between the two.
I need to create a copy of each database on the same server and call them customers_test and orders_test.
If I simply restore production backup into new databases, I will end up with queries that join prod databases. I need them to join '_test' databases.
I guess the problem here is that I am dealing with a copy of database (named differently) on the same server.
As I see, the only way is to edit every procedures to replace.
select ....
from customers.table a
join orders.table b on a.customer_id = b.customer_id
with
select ....
from customers_test.table a
join orders_test.table b on a.customer_id = b.customer_id
Am I on right path? How would you do it?
Hope it makes more sense now.
Thanks,