Wednesday, August 27, 2008

When you last changed password of sa

Changing the passwords regularly is an important requirement of robust security implementation. And it becomes more important when login is sa. To analyze that when last time you implemented this good practice, use following script.

USE Master
GO

SELECT sid, [name], createdate, updatedate
FROM master.dbo.syslogins
WHERE [name] = 'sa'
GO


And if specific to SQL Server 2005 then

USE Master
GO

SELECT [name], sid, create_date, modify_date
FROM sys.sql_logins
WHERE [name] = 'sa'
GO



The script will return name, sid, creation date and update/modification date of all of your logins. As sa account can not be updated/modified except that of password, so update date here will be the date when password of sa was changed. And if no name condition is provided then update date tells you any last any update for other logins.

USE Master
GO

SELECT [name], sid, create_date, modify_date
FROM sys.sql_logins
GO

No comments:

Post a Comment

Any Comments: