sqlserver.information_schema.DATABASE_USERS.sql Maven / Gradle / Ivy
The newest version!
SELECT
NAME AS USERNAME,
CREATE_DATE,
MODIFY_DATE,
TYPE_DESC AS TYPE,
AUTHENTICATION_TYPE_DESC AS AUTHENTICATION_TYPE
FROM
SYS.DATABASE_PRINCIPALS
WHERE
TYPE_DESC NOT IN ('A', 'G', 'R', 'X')
AND SID IS NOT NULL
AND NAME != 'GUEST'
ORDER BY
NAME;
© 2015 - 2025 Weber Informatics LLC | Privacy Policy