Can I tell if sp_grantlogin has been issued?

  • Greetings, I am trying to figure out how to tell if sp_grantlogin has been issued for a particular user. Is there a table in which that is kept or a procedure I can run to gather that information? Thanks.

  • check syslogins' "denylogin" and "hasaccess" columns on the master database.

    Cheers,


    * Noel

  • Greetings, what is the combination if sp_grantlogin has been issued for a particular user?

    Thanks.

  • I would expect "denylogin" = 0 and "hasaccess" = 1


    * Noel

  • For database level checking use sysusers table for each database moreover the question was not really clear.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

  • THe reason for the question is that some time ago I had issued the command

    exec sp_grantlogin '<user>'

    and had forgotten which user I had issued the grant to. I wanted to be able to go back and make that determination.

  • It appears that syslogins is the view I want to look at. The syslogins view shows WIndows Users and their access to the database, isn't that what sp_grantlogin impacts? The sysusers shows information about database accounts. If I understand correctly sp_grantlogin affects how windows users are authenticated in the sqlserver database, is that correct or am I missing something? Thanks.

  • Yes syslogins will have information about logins at server level and sysusers will have users details at database level.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

  • On SQL Server 2000, syslogins is the system table you're looking for. And you are correct, sp_grantlogin allows a Window security principal (user, group, or computer account) to connect to SQL Server. The sp_grantlogin system stored procedure does not work for SQL Server-based logins.

     

    K. Brian Kelley
    @kbriankelley

Viewing 9 posts - 1 through 8 (of 8 total)

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