Forum Discussion

Sureshmannem's avatar
Sureshmannem
Frequent Visitor
1 year ago
Solved

Support - SQL Analytics Endpoint Feasibility for Pipeline Orchestration in Fabric

Dear Team,   We’ve initiated the migration of our data solution orchestration from Azure Data Factory (ADF) to Microsoft Fabric. Our solution relies heavily on SQL queries and stored procedure log...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Sureshmannem,

    To your follow-up: yes, you can execute SQL queries and stored procedures from within a Notebook in Fabric, using the built-in %%sql magic command.

    * Running a SQL Query saved in the Lakehouse (via SQL Analytics Endpoint). If you’ve saved a query (for example, a view or just want to run a raw T-SQL statement), you can execute it like this:

    %%sql
    SELECT * FROM YourLakehouse.dbo.YourTable

    Or if you’ve created a view or saved query:

    %%sql
    SELECT * FROM dbo.YourSavedView

    Make sure the the Notebook must be attached to the Lakehouse you're querying, and the SQL Analytics Endpoint must be published.

    * For executing a stored procedure

    If you’ve defined a stored procedure in the SQL Endpoint (something like usp_MyProcedure), you can call it like this:

    %%sql
    EXEC dbo.usp_MyProcedure

    And If your stored procedure takes parameters:

    %%sql
    EXEC dbo.usp_MyProcedure @Param1 = 'Value1', @Param2 = 123

     

    If I misunderstand your needs or you still have problems on it, please feel free to let us know.  

    Best Regards,
    Hammad.