Use can use synonyms here just pass a DbName as variable like this
Declare @Dbname varchar(255)
Declare @qry varchar(255)
Set @Dbname="Name of the dataBase"
Set @qry='Create synonym ABC for'+@DbName+'.dbo.table1'
Exec (@qry)
Now use this
IF EXISTS (SELECT 1 from sysobjects where id=object_id(''SN_DWTableCustomer'') and xtype=''SN'')
BEGIN
DROP VIEW xxx
Create view xxx as Select * from ABC
END
ELSE
BEGIN
Create view xxx as Select * from ABC
END
For better understanding use the below links
https://www.techonthenet.com/oracle/synonyms.php
What is the use of SYNONYM in SQL Server 2008?
Please reply.