Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
I'm working on a solution in Microsoft Fabric where I need to accomplish two main goals:
Create tables with full SQL Server features such as primary keys, indexes, constraints, etc.
Execute a complex stored procedure that:
Performs cross-referencing between tables.
Performs UPSERT (update or insert) operations based on the logic.
Here’s the architectural setup I’m working with:
I can create fully featured tables in the Fabric Database, which supports standard SQL features like PKs, indexes, constraints — great for my data model.
For SPs that don’t need cross-reference logic or DML, these work fine inside the Fabric Database.
The stored procedure I need to run performs cross-references between tables (think joins across silver and gold) and includes DML (UPDATE, INSERT, etc.).
To perform cross-reference logic, I have to use the SQL Endpoint of the Fabric Warehouse.
However, SQL Endpoints in Fabric are read-only, so any DML operations fail.
Since I can't run DML inside SQL Endpoints:
I could create SPs or views in the SQL Endpoint purely for reading / cross-reference logic.
Then use Data Pipelines to do the actual data copy (UPSERT) into the target Fabric table.
My Questions:
Hi @aditridant ,
Thanks for posting in Microsoft Fabric Community.
Regarding your scenario - where the stored procedure needs to perform cross-referencing between tables (such as across Silver and Gold layers) along with DML operations - it’s worth noting that Microsoft Fabric does support cross-database and cross-warehouse queries within the same workspace.
This means you can:
Join tables from different SQL Databases or Warehouses using three-part naming (DatabaseName.SchemaName.TableName)
Perform DML operations like INSERT INTO ... SELECT FROM across these items
Include this logic inside stored procedures, provided all referenced objects are part of the same workspace.
For example:
To enable this, ensure the required databases or warehouses are added to Object Explorer using the + Warehouses action. Once added, they can be referenced directly in your SQL queries and stored procedures.
Please follow this link for step by step procedure: Query the SQL Analytics Endpoint or Warehouse - Microsoft Fabric | Microsoft Learn
If your current setup spans multiple workspaces, or if you're using the SQL Endpoint (read-only) for part of the logic, those limitations would still apply. In such cases, using Data Pipelines or Notebooks for the write operations remains a valid alternative.
Hope this helps. Please reach out for further assistance.
If this post helps, then please consider to give a kudos and Accept as the solution to help the other members find it more quickly.
Thank you.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.