I have rwo Databases, let's say DB1 and DB2 which DB2 is a copy of DB1 and exactly the same.I also have an empty third Database named Main.How can i create a view within the Main database from the tables of DB1 and DB2.For example if [person].[person] is a table in DB1 and DB2,something like this:
CREATE VIEW v1 AS
SELECT * FROM [DB1].[person].[person]
UNION
SELECT * FROM [DB2].[person].[person];
P.S. All 3 databases are on the same server!