Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql list users and roles

-- SQL Server: list of users and roles
SELECT dp.NAME      AS principal_name,
       dp.TYPE_DESC AS principal_type_desc,
       o.NAME       AS object_name,
       p.PERMISSION_NAME,
       p.STATE_DESC AS permission_state_desc
FROM sys.database_permissions p
         LEFT OUTER JOIN sys.all_objects o
                         ON p.MAJOR_ID = o.OBJECT_ID
         INNER JOIN sys.database_principals dp
                    ON p.GRANTEE_PRINCIPAL_ID = dp.PRINCIPAL_ID;
Comment

PREVIOUS NEXT
Code Example
Sql :: get rows affected mysql python 
Sql :: start mysql linux terminal 
Sql :: mysql current user 
Sql :: oracle split string 
Sql :: What is the compatibility level of a SQL database 
Sql :: oracle apex list connected users 
Sql :: update in sql 
Sql :: mysql show tables in database 
Sql :: dbms_output.put_line 
Sql :: last 6 months postgresql 
Sql :: mysqldump password 
Sql :: alter table change default 
Sql :: sql select except null 
Sql :: add postgresql to path 
Sql :: reset sql auto increment 
Sql :: inner join php my admin 
Sql :: mysql login console 
Sql :: mysql select last row for each group 
Sql :: mysql sysdate 
Sql :: show tables postgresql 
Sql :: psql client write to bash variable 
Sql :: sql delete multiple conditions 
Sql :: mysql tables max count 
Sql :: sql rename column 
Sql :: mysql reset root password 
Sql :: mysql docker 
Sql :: foreign key sqlite3 python 
Sql :: sql order by case 
Sql :: docker open terminal mysql server 
Sql :: pl sql ptint 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =