Tag Info

New answers tagged

1

The following logins will be created on installation. They are containers for the accounts that the SQL Server Database Engine & Agent run under. [NT SERVICE\MSSQLSERVER] [NT SERVICE\SQLSERVERAGENT] The other accounts are groups that have been manually added into your SQL instance. BUILTIN\Administrators was installed by default in SQL Server 2005 ...


4

Thomas has explained why that stored procedure isn't capturing orphaned Windows users, but here is how you can check: SELECT p.name FROM database_name.sys.database_principals AS p WHERE [type] IN (N'U', N'G') AND NOT EXISTS ( SELECT 1 FROM sys.server_principals AS sp WHERE sp.sid = p.sid ); If you need to do this for all databases, you can generate ...


4

That stored procedure sp_change_users_login only reports on SQL users, not Windows users. Here is the actual reporting query that the stored procedure uses (you can get the stored procedure text with sp_helptext 'sp_change_users_login'): select UserName = name, UserSID = sid from sysusers where issqluser = 1 and (sid is not null and sid <> 0x0) ...



Top 50 recent answers are included