My Development team contacted me and said they are not able to access database “The server principal “XYZ\USER” is not able to access the database “YourDBName” under the current security context”
when I looked into server server I found –
- Login was there and access was granted.
- When I looked into database I found user was disable ( Red down arrow mark )
Here are two solutions –
- Most of the people recommended to recreate use by deleting and reading into database.
But main reason why it’s disabled because user is not having connect permission to database.
- if you grant connect permission it will resolve your issue.
grant connect to [xyz\user]