console/mssql: simplify sql query for fetching schemas list

GitOrigin-RevId: 0d70973991c61b8f06efe61032bcfbfe05a89ded
This commit is contained in:
Aleksandra Sikora 2021-05-25 11:35:28 +02:00 committed by hasura-bot
parent d3611af58d
commit a5ce316a96

View File

@ -212,10 +212,13 @@ SELECT
s.name AS schema_name
FROM
sys.schemas s
INNER JOIN sys.database_principals p ON (s.principal_id = p.principal_id)
WHERE
p.type_desc = 'SQL_USER'
AND s.name NOT IN ('guest', 'INFORMATION_SCHEMA', 'sys')
s.name NOT IN (
'guest', 'INFORMATION_SCHEMA', 'sys',
'db_owner', 'db_securityadmin', 'db_accessadmin',
'db_backupoperator', 'db_ddladmin', 'db_datawriter',
'db_datareader', 'db_denydatawriter', 'db_denydatareader'
)
ORDER BY
s.name
`,