July 20, 2004 at 6:57 pm
Hi everyone,
I have a user who has read/write permissions in database A and read permission in database B. Database A has a view X that reads info from database B. When the user tries to run the view in database A, she gets the following error:
“Server user 'XXXXXXXX' is not a valid user in database 'B'.”
Why is this happening?
I checked the select statement in the view and all it is doing is selecting by joining some tables in database B.
July 20, 2004 at 7:08 pm
Can she do anything in database B? Have you ran sp_change_users_login 'Report' to see if the SID is correct?
Derrick Leggett
Mean Old DBA
When life gives you a lemon, fire the DBA.
July 20, 2004 at 7:11 pm
Try to drop the user from database B and re-grant him/her to access database B with proper permissions.
July 20, 2004 at 8:48 pm
Try researching
EXEC sp_change_users_login 'Auto_Fix', 'UserNameHere'
More information in BOL
Good Hunting!
AJ Ahrens
webmaster@kritter.net
July 21, 2004 at 10:35 am
Thank you everyone. I'll let you know what I find out about this problem.
July 21, 2004 at 10:47 am
I'd go with
exec sp_change_users_login 'Update_One', 'username'
July 21, 2004 at 12:08 pm
OK, just found out that the user is not in database B. When I go to EM, Security, Logins, and look at the user's database access, the user has access to the database B. But when I went to the database, Users, she was not listed in there. I added her to the database and now everything is fine. So it seems like sql server did half the job I asked it to do when I created this user.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply