var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: query to get the count of users and logins
I need a query for getting the list of users in a server(1 application) and list of logins as well .
use <userdefined database>
select count(*) from sysusers
select count(*) from syslogins
is the above statements are right or wrong ,if not , please guide me in getting the count of users and logins from the current server or db.
If you want the list of Logins on the server is one thing, if you want list of users with login name by DB is another.
I will assume is the second, for each DB ( you can make a cursor to go through the exisiting DBs) run:
select l.suid as "SUID", u.uid as "UID", u.name as "User Name", l.fullname as "Full Name"
from sysusers u, master..syslogins l
where u.suid = l.suid
--where l.name = u.name
Last edited by Catarrunas; 03-05-14 at
I need to retreive the users/logins w.r.t the database
There is no login per database; logins is per Sybase server instance and users is per database i.e. you'll need one select from syslogins in the master DB and multiple selects from sysusers depending on the number of databases.
Thanks for that , now i am pretty clear and got the desired output