This script will return a list of all logins that are in use on the current database and also the creation date and modified date of the user. Also the roles that they are assigned to are also returned.
This can be useful to companies who must audit their SQL server databases for SOX compliance.
Example Output:
Name
Creation Date
Last Modified
Account Type
Roles
domain\is
4-Aug-04 16:04:57
4-Aug-04 16:04:57
Windows Account
db_datareader
dbo
6-Aug-00 1:27:55
6-Aug-00 1:27:55
SQL Server User
db_owner
guest
6-Aug-00 1:27:55
9-Jul-01 11:39:31
SQL Server User
db_datareader
LandSurveyRead
19-Jul-04 9:59:56
19-Jul-04 9:59:56
SQL Server User
db_datareader
Phonebook
2-Aug-05 12:44:59
2-Aug-05 12:44:59
SQL Server User
scobb
6-Oct-04 10:20:45
6-Oct-04 10:20:45
SQL Server User
db_datareader
Requests
18-Feb-04 8:52:33
18-Feb-04 8:54:30
SQL Server User
db_datareader, db_datawriter, db_owner
UserInformationRead
13-Feb-04 9:04:17
13-Feb-04 9:04:17
SQL Server User
db_owner
UserInformationWrite
10-Aug-04 8:55:55
10-Aug-04 8:55:55
SQL Server User
db_owner
.csharpcode
{
font-size: small;
color: black;
font-family:...