cancel
Showing results for 
Search instead for 
Did you mean: 
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 I
Resolver I

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 I
Resolver I

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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors