How to add Admin role to user from SQL in D365FO
In SecurityRole table we will find all roles.
Execute the below statement to know the system admin role Recid.
Select Recid,* from SecurityRole where NAME like 'sys%'
Insert the data into SECURITYUSERROLE table with username and role recid. Execute the below statement.
insert into SECURITYUSERROLE (USER_, SECURITYROLE,ASSIGNMENTSTATUS,ASSIGNMENTMODE) values('Kishore', 235,1,1)
If you want to update you can use the below statement.
update SECURITYUSERROLE set SECURITYROLE = 235 where USER_ = 'Kishore'
Reference : Click here
Keep Daxing!!