Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
laailalalaa
Yak Posting Veteran
57 Posts |
Posted - 2009-03-02 : 07:29:38
|
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 publicexec 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 execute the following query:select uid, name from sys.sysusersonly 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 |
|
subhash chandra
Starting Member
40 Posts |
Posted - 2009-03-02 : 07:50:21
|
Make sure you are logged in as "sa" (or a login of sysadmin role) when running the query to get the list of all logins. |
 |
|
laailalalaa
Yak Posting Veteran
57 Posts |
Posted - 2009-03-02 : 09:30:51
|
i did login in as an 'sa', still only 3 users appear in the result set |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-03-02 : 09:52:27
|
Did you execute under particular db? Users are associated with database. |
 |
|
laailalalaa
Yak Posting Veteran
57 Posts |
Posted - 2009-03-03 : 03:48:04
|
thanks sodeep, that was the problem |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-03-04 : 11:28:43
|
quote: Originally posted by laailalalaa thanks sodeep, that was the problem
Good . |
 |
|
|
|
|