Avatar of atljarman
atljarman
 asked on

SQL Server Express Triggers to Compare hashed passwords before updating user passwords

I recently asked a question where i need to develop a way to compare the last 5 passwords for a user before they update their password in a SQL database prior to the password being changed.  I asked this using the .Net engine https://www.experts-exchange.com/Database/MS-SQL-Server/Q_28553621.html and seem to not be making it very far.

It made me think that this has to be a common issue that maybe i'm not looking at it the right way.  Is there a way to use SQL Server Triggers or procedures to compare the hashed passwords.   For example, I have a PasswordHistory table in the database that stores the history of the hashed password which are copies of the hashed password in the aspnet_Membership table for the users.  I imagine that you could create a temporary table that the password that is suggested is first inserted and then if it is a comparison reject the update of the membership table.  

I have no real idea how to write SQL Triggers or Procedures so I am reaching out to you all to see if there is an answer.  I've been working on this issue for 6 months and intensely the last three weeks.  Thank you in advance.
Microsoft SQL Server 2008ASP.NETC#

Avatar of undefined
Last Comment
atljarman

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Vitor Montalvão

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
atljarman

ASKER
Ok.  So the user names and passwords are stored in tables that are accessed and updated by .net.  I think that is different than sql server logon user and passwords.  I think your recpmmendation is kob th latter, correct?  Thank you for trying to help.
Vitor Montalvão

Aren't SQL Server logins?
atljarman

ASKER
These are ASP .Net Membership SQL Server database passwords - This was solved on another question but will award points even though it was answering a different question.   I don't think I was asking the right question.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck