troubleshooting Question

SQL user exists in database but not in security SQL Server 2019

Avatar of HKFuey
HKFueyFlag for United Kingdom of Great Britain and Northern Ireland asked on
SecurityMicrosoft SQL Server
7 Comments1 Solution20 ViewsLast Modified:
If I look at user properties it says "SQL user without login"

I have tried this which has worked in the past:
USE Master
EXEC sp_change_users_login 'Auto_Fix', 'MY_SQL_USER'
I get:
The number of orphaned users fixed by updating users was 0.
The number of orphaned users fixed by adding new logins and then updating users was 0.


So I tried this:
USE MyDatabase
EXEC sp_change_users_login 'Auto_Fix', 'MY_SQL_USER'
I get:
Msg 15600, Level 15, State 1, Procedure sp_change_users_login, Line 237 [Batch Start Line 0]
An invalid parameter or option was specified for procedure 'sys.sp_change_users_login'.
ASKER CERTIFIED SOLUTION
Darran BrownDBA

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros