• I know that this might not be constructive, but I had to ask.

    Why do you want that security measure to avoid repeated passwords, but you limit your passwords to 10 characters and store them in plain text? Would it be just to give you a false security?

    To avoid being useless, I guess that you were after something like this, but remember that keeping your system the way it is now, might cause security/privacy issues:

    CREATE TABLE #Password_His

    (

    playerid int not null,

    password nchar(10) not null,

    PasswordDate datetime

    );

    INSERT #Password_His

    VALUES( 1, 'Password01', GETDATE() - 11),

    ( 2, 'Password02', GETDATE() - 10),

    ( 3, 'Password03', GETDATE() - 9),

    ( 4, 'Password04', GETDATE() - 8),

    ( 5, 'Password05', GETDATE() - 7),

    ( 6, 'Password06', GETDATE() - 6),

    ( 7, 'Password07', GETDATE() - 5),

    ( 8, 'Password08', GETDATE() - 4),

    ( 9, 'Password09', GETDATE() - 3),

    ( 10, 'Password10', GETDATE() - 2),

    ( 11, 'Password11', GETDATE() - 1);

    DECLARE @Exists bit = 0,

    @Password nchar(10) = 'Password04';

    SELECT @Exists = 1

    FROM (

    SELECT TOP 10 [password]

    FROM #Password_His

    ORDER BY PasswordDate DESC)x

    WHERE [password] = @Password;

    SELECT @Exists;

    GO

    DROP TABLE #Password_His;

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2