What is the best approach for joining two tables from different databases? In my situation, I have a development database that has a postfix such as _DEV, while in production there is _PROD.
The problem is that if I join these two tables, I need to reference the full database name, such as DB1_DEV.dbo.table1 INNER JOIN DB2_DEV.dbo.table100
Work well, but if you want to move it into production, it will be a night's sleep, because I have to change them.
thanks
source share