mssql sqlserver 获取sql登录密码的修改人


摘要:
下文讲述通过sql日志
获取sql账户的密码修改人的相关信息
实验环境:sqlserver 2008 R2


USE [master]
GO

CREATE LOGIN [sqlLoginInfo] WITH PASSWORD=N'pwd123', DEFAULT_DATABASE=[master], 
DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
---更改用户密码\
USE [master]
GO
ALTER LOGIN [sqlLoginInfo] WITH PASSWORD=N'pwd4567890'
GO
---通过fn_dblog获取更改密码的用户信息
SELECT	[Transaction SID] ,suser_sname([Transaction SID]) AS '登录名'
FROM::fn_dblog(DEFAULT, DEFAULT)
WHERE [Transaction Name] = 'ALTER LOGIN'