Ajouter utilisateurs orphelins/detecte-user.sql

This commit is contained in:
Hubert Cornet 2023-10-18 14:11:09 +02:00
parent 15aad0f516
commit 91385ea381

View File

@ -0,0 +1,6 @@
SELECT dp.type_desc, dp.sid, dp.name AS user_name
FROM sys.database_principals AS dp
LEFT JOIN sys.server_principals AS sp
ON dp.sid = sp.sid
WHERE sp.sid IS NULL
AND dp.authentication_type_desc = 'INSTANCE';