users do not appear in sys.sysusers

  • as an 'sa' i wrote a script that created about 100 logins and users for a previously created database as follows:

    use [dbName]

    grant create table, create view, create function, create procedure, create default to public

    exec sp_addlogin 'username','password','dbName','us_english'

    exec sp_grantdbaccess 'username'

    afterwards i login as several different users and do all sorts of operations on dbName.

    when i log in as an 'sa' execute the following query:

    select uid, name from sys.sysusers

    only 3 users from the previously created ones are in the result set.

    does anyone know how can i get all the users to be in sys.sysusers?

    thank you

  • Just some basic questions:

    What version of SQL Server are you running?

    Did you get any errors when you ran your script that created the users?

    Did you run the query against the sysusers right after you created them to ensure they were there at that time?

    Did you run any operations during this time that modified logins or users?

    Are you able to login as any of the users that are not showing up?

    This should help steer the direction.

    Cheers,

    Brian

  • the problem was i didn't run the query agains the database on which users where associated:)

    now it works

    thanks

Viewing 3 posts - 1 through 2 (of 2 total)

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