简体   繁体   中英

Error when writing a table into a Power BI Datamart db [CREATE TABLE permission denied in database..]

I'm curious to know whether or not it is possible to create a table in Datamart using SQL Server Management Studio. Just a note, Power BI Datamart uses Azure SQL db. I have tried to do it using the following query:

 
SELECT Role = r.name, Member = m.name 
FROM sys.database_role_members as rm
INNER JOIN sys.database_principals as r
    ON r.principal_id = rm.role_principal_id
INNER JOIN sys.database_principals as m
    ON m.principal_id = rm.member_principal_id

and I get the following error:

Msg 262, Level 14, State 1, Line 1
CREATE TABLE permission denied in database 'db_powerbiprodgbr_20221028_10054574_fb38'.

 SELECT Role = r.name, Member = m.name  FROM sys.database_role_members as rm INNER JOIN sys.database_principals as r     ON r.principal_id = rm.role_principal_id INNER JOIN sys.database_principals as m     ON m.principal_id = rm.member_principal_id  

I then wanted to change my role from admin to admin_user using the following query:

ALTER AUTHORIZATION ON DATABASE::db_powerbiprodgbr_20221028_10054574_fb38 TO admin_user  

When I attempted to change my privilege I got the following error:

Msg 15247, Level 16, State 1, Line 1
User does not have permission to perform this action.

Could you please run the following statement on the Azure SQL database while logged in as the SQL Admin login of the logical server?

exec sp_addRoleMember 'dbmanager', 'powerbilogin'

After that powerbilogin will be able to create tables.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM