Find out SQL Server Logins and associated Server Roles

We have SQL Server 2000, 2005, 2008 and R2 in our environment.  We have several SQL Servers in our environment. I want to find out Server Logins and Server Roles Assigned in SQL Server. I want following information. Is there any way I can
find it? Any help would be highly appreciated.
SQL Server
Login
Role Assigned
Server1
Login1
bulkadmin
Server1
Login2
serveradmin
Server1
Login1
diskadmin
Server2
Login1
public

The query only returns those logins that are assigned to at least one server role.if they are not assigned it will not return that login.If you want to return all the login then use the query below.Note that query returns public for those login with no server
role assigned.
select @@SERVERNAME
,sl.name
,isnull(DB_Roles.Roles,'Public')
from syslogins sl
left join
select 'sysadmin' as Roles
union all
select 'securityadmin'
union all
select 'serveradmin'
union all
select 'setupadmin'
union all
select 'processadmin'
union all
select 'diskadmin'
union all
select 'dbcreator'
union all
select 'bulkadmin'
union all
select 'No serverRole'
union all
select 'public'
) DB_Roles
on
Case When sl.sysadmin=1 and DB_Roles.Roles='sysadmin' then 'sysadmin'
When sl.securityadmin=1 and DB_Roles.Roles='securityadmin' then 'securityadmin'
When sl.serveradmin=1 and DB_Roles.Roles='serveradmin' then 'serveradmin'
When sl.setupadmin=1 and DB_Roles.Roles='setupadmin' then 'setupadmin'
When sl.processadmin=1 and DB_Roles.Roles='processadmin' then 'processadmin'
When sl.diskadmin=1 and DB_Roles.Roles='diskadmin' then 'diskadmin'
When sl.dbcreator=1 and DB_Roles.Roles='dbcreator' then 'dbcreator'
When sl.bulkadmin=1 and DB_Roles.Roles='bulkadmin' then 'bulkadmin'
else null end=DB_Roles.Roles
order by 2
Vinay Valeti| If you think my suggestion is useful, please rate it as helpful. If it has helped you to resolve the problem, please Mark it as Answer
works like a charm, thank you!!!

Similar Messages

  • How to find out sql server administrator account in sql server 2008 R2

    how to find out sql server administrator account in sql server 2008 R2
    adil

    there is any way to find out actual administrator
    because i forget that user i used to logon to server and installed sqlserver
    adil
    Hi adilahmed,
    According to your description, you forgot the account which was used to install SQL Server. SQL Server service account information is stored in Windows Registry database. You can get this information from Services Console or SQL Server Configuration.
    For example, to get account information from Services Console.
    1. Go to Start > Run > Services.msc
    2. Right Click on SQL Server Service, i.e. “SQL Server (InstanceName)” and go to properties
    3. The account information is available under Log On tab.
    Or you can get the information by using DMV and so on.
    SELECT servicename, service_account FROM   sys.dm_server_servicesGO
    If you now log in SQL Server by using sysadmin account, you can check all login names in security and find the original account to login.
    Thanks,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Sql to find out combination of true and false

    Hi all,
    Could any one provide the sql to find out combination of true and false . For eg: if I have 3 elements a , b c i would like to get below o/p
    a   b  c
    t t t
    t t f
    t f f
    f f f
    t f t
    f f t
    your reply is greatly appreated - thank you

    Do you mean something like this (all permutations) ?
    SQL> with t as (
      2    select 't' bool from dual union all select 'f' from dual)
      3  select a.bool a,b.bool b,c.bool c
      4  from t a,t b,t c
      5  /
    A B C
    t t t
    t t f
    t f t
    t f f
    f t t
    f t f
    f f t
    f f fIf not, then you already got correct answers regarding boolean type in sql.
    Best regards
    Maxim

  • Any problems if run SQL Server 2005 and Essbase Server on 1 machine?

    <p>Hi, I would like to know if there's any problems in terms ofperformance when running SQL Server 2005 and Essbase Server on 1machine?</p><p> </p><p>Currently, my users are using Excel File (Lock & Send) toupload data to the Essbase Server and it took about 30 mins perexcel file upload. Application Manager is installed on client's andserver PC for adminstration.</p><p> </p><p>Now, I need to implement Datawarehouse and wish to installSQL Server 2005 on the current machine my Essbase Server isrunning. I will need to do simple SQL statements on the SQL Server2005 such as Update, Select, Insert etc.</p><p> </p><p>When comes to performance issues, will my current Essbase Serverbe affected? What if 2 users are accessing the Essbase Server andSQL Server at the same time? Will any data be lost in the midst ofextracting data?</p><p> </p><p>I hope someone can advise. Appreciate that. Thank you.</p>

    <blockquote>quote:<br><hr><i>Originally posted by: <b>roy_choy</b></i><BR><BR>Currently, my users are using Excel File (Lock & Send) to<BR>upload data to the Essbase Server and it took about 30 mins per<BR>excel file upload. <BR>I hope someone can advise. Appreciate that. Thank you.</p><hr></blockquote><BR>My test server is running both Essbase and SQLServer, but I think that you have a bigger problem.<BR><BR>If a lock and send is taking 30 minutes, you are using the wrong technology to load Essbase. You should really consider doing the load using a data load rule. If that isn't the problem, it may be that you are having a real performance problem. If you are moving enough data to require a half hour load, it should be probably be loaded from a text file, or even a spreadsheet, using a data load rule. Text file loads are a bit better than excel, especially when there are formatting issues. <BR><BR>Lock and sends are fine for changing parameters and doing adjustments, but heavy duty data loads really work a lot better with load rules.

  • How to find out when 'enable secret' and username secret' was set/changed

    Hi,
    I was wondering if it is possible to find out when 'enable secret' and username secret' was set or changed last time on an IOS based machine.
    Is there any show command or kind of timestamp or MIB which can be read out?
    tnx Ralf

    Probably your syslog server would give you that info.

  • Exchange Server 2013 and RADIUS server(freeRADIUS2)

    I am a student and doing an internship. I have to test Microsoft Exchange Server 2013.
    I am using Windows Server 2012, I already installed Exchange
    Server 2013 on it and everything works as intended.
    But I couldn't find out how to configure my Windows Server 2012 in order to authenticate my mailbox users from Exchange Server 2013 with a RADIUS
    server which is not on my Windows Server 2012. I have to use their RADIUS server ( freeRADIUS2 ), the RADIUS server from
    the company where I am doing my internship.
    I already did the checklist that is on http://technet.microsoft.com/en-us/library/cc772591.aspx. I configured the NPS as
    a RADIUS proxy, because that's what I need.
    So after doing everything that is on that checklist, my question is:
    Is it possible that the Exchange Server 2013 will use my NPS which is now configured as a NPS RADIUS proxy to authenticate my mailbox users that I have on my Exchange Server 2013?

    thanks for such a quick response.
    Just a small question about the link that you put. Does member server mean other server other than domain controller?
    Regards,
    Yes, Also the server on which you are installing Exchange should have exchange installed.
    Cheers,
    Gulab Prasad
    Technology Consultant
    Blog:
    http://www.exchangeranger.com    Twitter:
      LinkedIn:
       Check out CodeTwo’s tools for Exchange admins
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • How do you find out how many views and downloads a podcast has had?

    How do you find out how many views and downloads a podcast has had?

    Your question may be better placed in the "Producing Podcasts" forum instead of here in iTunes for Windows.
    I assume though (I don't produce Podcasts), that the host server (where the Podcast is downloaded from) has the option of providing that information to the Podcast's producers.
    Two points though;
    That information is likely to only be available to the producers of that Podcast, not to listeners (or competitors)
    It's almost certainly an add-on service, that needs to be paid for, in addition to the hosting service.
    If it's your Podcast, check with the host service that you use.

  • Is there a 32 Bit edition available for windows server 2012 and windows server 2008

    Dear All,
    Is there a 32 Bit edition available for windows server 2012 and windows server 2008?
    Regards,
    Ahmed

    Hi,
    Quote:
    All editions of Windows Server 2008 R2 are 64-bit only.
    Reference link below(session Supported upgrade paths):
    https://technet.microsoft.com/en-us/library/dd379511(v=ws.10).aspx
    And based on MS official description about system requirement for Windows Server 2012/2012 R2, we may find out that they only has 64 bit OS.
    Best Regards,
    Eve Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Deploy Exchange 2013 , Lync server 2013 and shrepoint server 2013

    Hi dears ,
    I have a deployment requirement in which I have to plan for deploy Exchange 2013 , Lync server 2013 and SharePoint server 2013 on premise for 500 user and for one organization , now I have been asked to provide the software and hardware requirement
    for this deployment .
    so I wonder , is there any guide or link to find the hardware and software requirements for this deployment ?

    Hi,
    You can refer to the link below about the hardware/system requirements for Lync Server 2013:
    https://technet.microsoft.com/en-us/library/gg398438.aspx
    Note: it is not supported to install Lync Server in the same computer with DC, Exchange Server and SharePoint Server.
    If you want to deploy Lync Server, you’d better read the guide firstly before deploy it:
    https://technet.microsoft.com/en-us/library/gg398616.aspx
    For the deployment of Exchange 2013 and SharePoint 2013, you can also post case on Exchange and SharePoint forum, and there are more experts will help you:
    Exchange 2013:
    https://social.technet.microsoft.com/Forums/office/en-US/home?category=exchangeserver
    SharePoint 2013:
    https://social.technet.microsoft.com/Forums/office/en-US/home?category=sharepoint
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • My mac book pro has got 41 GB of other stuff on it clogging it up how do I find out what is rubbish and delete it

    my mac book pro has got 41 GB of other stuff on it clogging it up how do I find out what is rubbish and delete it. To free up some memory. I can't believe I have filled it up intentionally.

    For information about the Other category in the Storage display, see this support article.
    Empty the Trash if you haven't already done so. If you use iPhoto, empty its internal Trash first:
    iPhoto ▹ Empty Trash
    Then reboot. That will temporarily free up some space. Do the same in other applications, such as Aperture, that have an internal Trash feature.
    According to Apple documentation, you need at least 9 GB of available space on the startup volume (as shown in the Finder Info window) for normal operation. You also need enough space left over to allow for growth of your data. There is little or no performance advantage to having more available space than the minimum Apple recommends. Available storage space that you'll never use is wasted space.
    If you're using Time Machine to back up a portable Mac, some of the free space will be used to make local snapshots, which are backup copies of files you've recently deleted. The space occupied by local snapshots is reported as available by the Finder, and should be considered as such. In the Storage display of System Information, local snapshots are shown as Backups. The snapshots are automatically deleted when they expire or when free space falls below a certain level. You ordinarily don't need to, and should not, delete local snapshots yourself.
    See this support article for some simple ways to free up storage space.
    You can more effectively use a tool such as OmniDiskSweeper (ODS) to explore your volume and find out what's taking up the space. You can also delete files with it, but don't do that unless you're sure that you know what you're deleting and that all data is safely backed up. That means you have multiple backups, not just one.
    Deleting files inside an iPhoto or Aperture library will corrupt the library. Any changes to a photo library must be made from within the application that created it. The same goes for Mail files.
    Proceed further only if the problem isn't solved by the above steps.
    ODS can't see the whole filesystem when you run it just by double-clicking; it only sees files that you have permission to read. To see everything, you have to run it as root.
    Back up all data now.
    If you have more than one user account, make sure you're logged in as an administrator. The administrator account is the one that was created automatically when you first set up the computer.
    Install ODS in the Applications folder as usual. Quit it if it's running.
    Triple-click anywhere in the line of text below on this page to select it, then copy the selected text to the Clipboard by pressing the key combination command-C:
    sudo /Applications/OmniDiskSweeper.app/Contents/MacOS/OmniDiskSweeper
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning to be careful. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The application window will open, eventually showing all files in all folders, sorted by size with the largest at the top. It may take a few minutes for ODS to finish scanning your files.
    I don't recommend that you make a habit of doing this. Don't delete anything while running ODS as root. If something needs to be deleted, make sure you know what it is and how it got there, and then delete it by other, safer, means. When in doubt, leave it alone or ask for guidance.
    When you're done with ODS, quit it and also quit Terminal.

  • Difference between Presentation Server Cache and BI Server Cache

    Hello Experts,
    What is the Diff b/w Presentation Server Cache and BI Server Cache
    Thanks,
    S Gouda

    Hello,
    Okay, what do you want to do about caching at BI server and Presentation server.
    A nQSXXXX.tmp is a temporary cache file which maintained by the BI Server for an analysis request by a user and is kind of shared data between the OBI Server and the OBI Presentation server. This is refereed as the 'Cursor Cache' which could be managed by going thru Administration> Manage Sessions > Clear Cursor Cache.These .tmp files are it is not related to BI Server cache.
    By Default, the BI Server Cache is stored in the and stored as NQSxxxxx.tbl files. [middlware_home]/instances/instance1/bifoundation/OracleBIServerComponent/coreapplication_obis1/cache]
    Caching occurs by default at the subrequest level, which results in multiple cache entries for some SQL statements. Caching subrequests improves performance and the cache hit ratio, especially for queries that combine real-time and historical data.
    Below are some useful links for cache management in OBIEE 11g.
    http://oraclebisolutions.blogspot.com/2013/02/obiee-11g-obi-server-and-presentation.html
    http://drazda.blogspot.com/2012/10/obiee-11g-cache-management.html
    http://allaboutobiee.blogspot.in/2012/03/cache-management-purging-cache.html
    Pls mark itf this helps. Else post the exact questions you have about this post.
    Thanks,
    SVS

  • How to find out list of users and their access on Sharepoint

    Hello Everyone
    How can i find out list of users and what access they have on SharePoint site? I want to create table with list of the users and their access?
    Thanks

    you can get the report using below powershell scripts. first one gives list of users in a site collection level.
    The second link generates the permissions reports for each user.
    http://techtrainingnotes.blogspot.com/2010/12/sharepoint-powershell-script-to-list.html
    https://sp2010userperm.codeplex.com/
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • How to find out the PATTERN, GRADIENT and BRUSHED objects?

    How to find out the PATTERN, GRADIENT and BRUSHED objects information in illustrator active document file. And also how to find the CMYK and RGB color information in illustrator file through javascript. Could you please provide any examples.

    I tried using the below code. But for both "cmyk" and "grayscale" pattern it gives only CMYK. Kindly check and advise.
    Code:
    var docRef = activeDocument;
    for(var i=docRef.inkList.length-1;i>=0;i--){
      var inkRef=docRef.inkList[i];
      var inkRefName=inkRef.name;
      alert(inkRefName);
      alert(inkRef.inkInfo.kind);
    Thanks for looking into this.

  • How do you find out if the transmitter and/or receiver leaves the session ?

    So , how do you find out if the transmitter and/or a receiver leaves the session , is there an event when this happens ?

    1. There is no list available from your end.
    2. You can't actually check. If you suspect a device has been, deauthorize it twice and then authorize it.
    (89509)

  • Query to find out the table name and column name..

    Hi Experts,
    I have an Oracle DB in which has more than 50 tables and 100,000 records. I want to get the record which contains *"ITxtVarValue references a non existing text"* the text.
    Is there any query there to find out the table name and column name of this particular record where it reside?
    Please help. Any help will be rewarded.
    Thanks,
    G

    Using this forum's search function, I found a thread that should give you an idea: How to find out a tablename
    C.

Maybe you are looking for

  • How do i stream content from my macbook pro to tv

    how do i stream content from my macbook pro to tv

  • Problem with Internal Fan

    Within the last couple of days my fan has been making a noise much louder than usual. The computer does not receive any direct sunlight and never feels hot to its touch. This has just happened all of a sudden. Other than that, it starts up and everyt

  • Problem connecting 6230 to Vista PC with Toshiba B...

    Hello, I recently got a new laptop with Vista installed. My 6230 used to connect well with my former PC (Win XP). Initially I managed to have PC Suite (6.83) work once and downloaded my contacts to the PC. Then sync stopped working for contacts but o

  • Does anyone know the best way to create a form that you can do a mail merge with?

    I have been asked to create a form that can be used to do a mail merge. At first I thought I could create it in indesign and then pdf the file and do form fields right in the pdf, but I'm not sure if you can do a mail merge with data in an excel file

  • Lightroom 3 opposed to lightroom 4

    Lightroom 3 has glow and sketch options that I am not seeing in lightroom 4, is anyonr else having this problem is so please tell me and if not tell me what I need to do to find these things.