How long since binary (password) field changed?

Posted on 2006-03-21
Last Modified: 2008-01-09
In MS SQL Server 2000, a financial application database stores passwords in a table SY01400 as a binary field.  The field is [SY01400.password].
PROBLEM:  I would like a way to determine how long it has been since the password was changed, so that I can remind the user to change their password.

I've tried to create a temporary table to store the userid and password as of a given date, and then test at some later time to see if the password has changed in the SY01400 table.  

However, any comparisons that I use don't detect changes in the password, because it's binary.


Question by:carlisaacson
    LVL 6

    Accepted Solution

    Create a trigger on the table to update a datetime field another table that corresponds to a userid

    Author Comment

    how does the trigger determine if the password was changed?
    LVL 20

    Assisted Solution

    Detect changes to database table /column

    Author Comment

    Thanks ACampona & Sirees.

    Earlier I found this article and used it on Northwinds successfully. I modified it slightly so instead of detecting changes to the row, it detected changes to a particular field.  I tried to adapt it to my situation in my database by having the binary_checksum test for changes to the password field.  

    CREATE   TABLE tbl_BinaryCheckPassword (USERID char, BCHECKSUM binary)
    INSERT   INTO tbl_BinaryCheckPassword
             SELECT   USERID, BINARY_CHECKSUM(password)
             FROM      SY01400

    When i run this, I get an error message:
    Server: Msg 8152, Level 16, State 9, Line 2
    String or binary data would be truncated.
    The statement has been terminated.

    That's why I ended up coming here.  

    I'm going to check for answers to that error message, and if still have questions, I will post another question.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now