I'm porting stored procedures from Sybase 15 to SQL Server 2008.

In Sybase this statement calcs an expiration date by adding a number of days to syslogins.pwdate (Date the password was last changed) and works fine:

SELECT @l_pwd_date = dateadd( day, @l_pwd_max_expire, pwdate)
FROM master.dbo.syslogins
WHERE name = @v_user

...but throws this error when trying to compile it in SQL Server 2008:

Msg 207, Level 16, State 1, Line 21 Invalid column name 'pwdate'.

syslogins in SQL Server 2008 no longer includes that column pwdate.

Does anyone know where could I find equivalent column in SQL Server 2008 or a workaround to find the date a login password was last changed?

  • 1
    FYI, syslogins is deprecated to sys.server_principals whic still doesn't have it. Nor sys.sql_logins
    – gbn
    Commented Dec 2, 2011 at 21:41

2 Answers 2


Use the PasswordLastSetTime option of the LOGINPROPERTY.

SELECT LOGINPROPERTY('YourLoginName', 'PasswordLastSetTime');
  • 1
    Appreciate the time Joe, thanks; it worked fine. Heads up for those using windows integrated authentication, it will return NULL because login_name must be the name of a SQL Server login.
    – Only You
    Commented Dec 5, 2011 at 13:57

select name, create_date from sys.sql_logins

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.