I'm writing a query where I need to query column names in two different databases on the same node. For example, consider the following code snippet:

```
Select * from [db1].sys.columns c1 where OBJECT_NAME(c1.object_id) = 'db1Column'
UNION ALL
Select * from [db2].sys.columns c2 where OBJECT_NAME(c2.object_id) = 'db2Column'

```

If I execute the code above on db1, it only returns rows from the first select. If I change the connection to db2, it only returns rows from the second select. How do I query from \*sys.Columns on different databases on the same server in the same query? I've worked around this by using a temp table but it's a messy solution. Thanks