Forum Discussion

Salvor71's avatar
Salvor71
Regular Visitor
1 year ago
Solved

Fabric SQL Databases cross reference

I've created two SQL datadases, DB1 and DB2, and I'd like to cross-reference objects (i.e. views, functions...) in my queries but it doesn't work, even when I use the "extended" name needed to connec...
  • Salvor71's avatar
    1 year ago

    Hi nilendraFabric ,

    yes I tried and it doesn't work, but now I'm clearing my head on this.

    For what I see, when you use the logical database name you are always referring to the SQL endpoint. Also, the only objects of the SQL database visible through the SQL endpoint are the tables: my logging.LogLevel view is defined in the database and I don't see it in the Views folder of the SQL endpoint, but I can create the same view in the Sql endpoint so that in a way solves the problem.

    Anyway you cannot reference the SQL endpoint from its database counterpart: if I run the query

    SELECT * FROM DB1.logging.LogLevel; 

    in the database DB1 I get the same reference error. If I run it from the SQL endpoint of another database, it works.

    So, in conclusion, cross-database reference is (currently?) only for SQL endpoint as stated in the docs, that's why I asked whether it will be supported in the future. We'll see.