Not sure of the exact source of the script that I've used in the past to do this, but it was similar to the one found here - What about orphaned windows users? – SQLServerCentral
This only works for SQL Server 2012 and higher.
Craig Russell thanks for the reply, let me go into a little more detal, I restored a database from an April 30th backup and named it a different name (GDB2020) , I did this from SSMS. I ran the script, (EXEC sp_change_users_login 'Update_One', 'sde', 'sde') now I;m trying to connect to it from ArcMap using the sde credentials and ArcMap is giving me error ...
The source of your issue is more likely to be the renaming of the geodatabase; this doesn't work because fully qualified table names (i.e. database.schema.table) are stored throughout the SDE system tables.