Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jvirgi
Helper III
Helper III

Creating a Stored Procedure in a Datamart?

Is this possible?  I created a datamart, and connect to it via the SQL endpoint in SSMS.  

 

Then in SSMS i tried to create a generic procedure with this code:

 

USE [db_name];  
GO  
CREATE PROCEDURE model.uspGetEmployeesTest2   
    @LastName nvarchar(50),   
    @FirstName nvarchar(50)   
AS   

    SET NOCOUNT ON;  
    SELECT *  
    FROM model.tablename
    WHERE attribute = @FirstName AND attribute2 = @LastName  
    ;  
GO  

 

 

But i just get a permission denied error.   Is there any way to grant myself permission to create this in the datamart?

1 ACCEPTED SOLUTION
marcosvin
Resolver II
Resolver II

Hello!

 

Currently there is no option to create procedures in Power BI datamart, only run SELECT commands.
To create stored procedures you will need to use other tools or functionality, such as Azure Synapse or Warehouse in Microsoft Fabric.

 

Analyzing datamarts (preview) - Power BI | Microsoft Learn

View solution in original post

2 REPLIES 2
jvirgi
Helper III
Helper III

Thank you @marcosvin .  I appreciate the confirmation

marcosvin
Resolver II
Resolver II

Hello!

 

Currently there is no option to create procedures in Power BI datamart, only run SELECT commands.
To create stored procedures you will need to use other tools or functionality, such as Azure Synapse or Warehouse in Microsoft Fabric.

 

Analyzing datamarts (preview) - Power BI | Microsoft Learn

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.