Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql server roles and users

-- 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 :: mysql breakline on string 
Sql :: rows to comma separated values in mssql 
Sql :: mysql server is not starting xampp 
Sql :: ddl materialized view 
Sql :: list index mysql cli 
Sql :: sqlfiddle example tables 
Sql :: install mysql 8 ubuntu 18.04 
Sql :: mysql return if it contains 
Sql :: sql random decimal 
Sql :: insert current timestamp in postgresql 
Sql :: oracle alter table add not null constraint 
Sql :: get current date data in mysql 
Sql :: create temporary table in mysql 
Sql :: postgresql CREATE EXTENSION pgcrypto 
Sql :: mysql reset auto increment to 1 
Sql :: sql fillna 
Sql :: sql select only time from datetime 
Sql :: mysql select where text contains 
Sql :: mysql round 
Sql :: show all public tables postgres 
Sql :: how to get table current identity value in sql server 
Sql :: alter tablespace add datafile 
Sql :: sql select divide column by number 
Sql :: oracle like case insensitive 
Sql :: How to get todays date and current time in mysql 
Sql :: docker run mysql image 
Sql :: alphabetical order mysql 
Sql :: set column to not null mysql 
Sql :: mysql workbench requires visual c++ 2019 redistributable package 
Sql :: clear query cache sql server 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =