IF EXISTS (SELECT name FROM sysobjects WHERE name = 'sp_$ndo$loginproc' AND type = 'P') DROP PROCEDURE [sp_$ndo$loginproc] GO CREATE PROCEDURE [sp_$ndo$loginproc] @appname VARCHAR(64) = NULL, @appversion VARCHAR(16) = NULL AS BEGIN IF SUSER_SNAME() IN ( SELECT SL.name AS LoginName FROM sys.sql_logins AS SL WHERE (is_expiration_checked = 1 and LOGINPROPERTY (SL.name, 'DaysUntilExpiration') = 2) ) PRINT 'Your password will be expired within 2 days, please change it ! ' IF SUSER_SNAME() IN ( SELECT SL.name AS LoginName FROM sys.sql_logins AS SL WHERE (is_expiration_checked = 1 and LOGINPROPERTY (SL.name, 'DaysUntilExpiration') = 1) ) PRINT 'Your password will be expired within 1 days, please change it ! ' END GO GRANT EXECUTE ON [sp_$ndo$loginproc] TO public GO
Comments
I traded my sanity for a railgun