added files from swmgmt03
This commit is contained in:
17
orphaned users.sql
Normal file
17
orphaned users.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
use artikel_superset
|
||||
|
||||
|
||||
select p.name,p.sid, 'DROP USER ['+p.name+']' as q
|
||||
from sys.database_principals p
|
||||
where p.type in ('G','S','U')
|
||||
and p.sid not in (select sid from sys.server_principals)
|
||||
and p.name not in (
|
||||
'dbo',
|
||||
'guest',
|
||||
'INFORMATION_SCHEMA',
|
||||
'sys',
|
||||
'MS_DataCollectorInternalUser'
|
||||
) ;
|
||||
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user