Server user X is not a valid user in database X

  • We have 20 databases on our SQL 2000 Server. Now a strange

    problem has appeared on some of the databases. Example:

    When a user 'X' with dbo permisssion right-click on a

    table in the database 'AAA' and selects All tasks>Generate

    SQL Script in Enterprise Manager he gets an error message.

    Error 916: Server user 'X' is not a valid user in

    database 'BBB'. If i give the user read-access in the

    database 'BBB' it works fine. The same problem appears on

    all tables and stored procdures in the database 'AAA'.

    This problem also occurs on other databases and the error

    always states that the user needs permission to the

    database 'BBB'.

  • quote:


    When a user 'X' with dbo permisssion right-click on a table in the database 'AAA' and selects All tasks>Generate SQL Script in Enterprise Manager he gets an error message.

    Error 916: Server user 'X' is not a valid user in database 'BBB'. If i give the user read-access in the database 'BBB' it works fine.


    Have you tried deleting and recreating the user's login? Does it happen with other users?

  • No, I have not deleted and recreated the user's login yet. I hope to find another solution. We have not noticed this problem with any other users.

    /Stefan

  • Howzit ..

    Make sure that the sql service account has full control permission on the drive or folder where the datafile resides .If you use the local system account make sure the system account \\pcname\system has full control on the drive or folder where the datafile resides . Just a thought ....

  • sql service account has full control.....

  • Have you recently applied SQL Server SP3 with 'allow cross-database ownship chaining' enabled?

  • I have recently applied SQL Server SP3 but with 'allow cross-database ownship chaining' disabled!

  • Did you ever have 'guest' user in database 'BBB' before?

    Edited by - Allen_Cui on 04/24/2003 09:13:04 AM

  • No!

    But now since I have dropped the database and restored it from a backup it seems to work??? Strange......

  • What was the default database for that login? I've had odd errors before when the default database is not what it should be.

  • I had a question pertaining to orphaned logins. I am a DBA working on SQL 7. Whenever I restore a DB somewhere I manually fix the users by deleting the users from the sysusers table of that DB and then re-creating the login again. How does SQL 2000 handle this? Are the logins correctly mapped to the UIDS in SQL 2000 or would we need still need to fix them like in SQL 7

  • Going to create another thread on this.

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply