Re: Find The Users and their roles for all the databases on the server

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 11/05/04


Date: Thu, 4 Nov 2004 23:29:28 -0600

Hi,
Execute the below system proc edure to get that information.

sp_helplogins <login_name>

To get all the Logins

sp_helplogins

-- 
Thanks
Hari
SQL Server MVP
"MANCPOLYMAN" <MANCPOLYMAN@discussions.microsoft.com> wrote in message 
news:D775C11C-5132-418F-BDB7-C9061CE73726@microsoft.com...
> can anyone point me in the right direction of how to loop through
> sysdatabases, take each dbname and the use thatname.sysusers to display 
> all
> my databases and which users they have.
>
> I'm pretty new to cursors and am having difficulty with looping through 
> the
> fist cursor, of dbnames.
>
> Any help greatly appreiated 


Relevant Pages

  • Re: Execute SQL Statment
    ... instead of or right after print @dbname. ... SQL Server MVP ... > I need to execute "SQL Statments" that belong to a script ... > declare dbname_cur cursor for select from ...
    (microsoft.public.sqlserver.server)
  • Re: Alter identity -field?
    ... replace the dbname and table name with actual ... DBCC CHECKIDENT (tablename, RESEED, 4000) ... SQL Server MVP ... > I have a table with int identity field ). ...
    (microsoft.public.sqlserver.clients)
  • Re: How to know if a table exist in a Stored Procedure?
    ... use dbname ... Select object_namefrom syscomments where text like '%table_name%' ... SQL Server MVP ... Jorge L. Cotarelo ...
    (microsoft.public.sqlserver.msde)
  • Find The Users and their roles for all the databases on the server
    ... take each dbname and the use thatname.sysusers to display all ... my databases and which users they have. ... fist cursor, of dbnames. ...
    (microsoft.public.sqlserver.programming)