how to know the permissions available to a window groups in sql server

  • how to know the permissions available to a user belong to a window groups in sql server database.

    And also how to know the window group of a user belongs too in sql server.

    Will appreciate the replys

  • Use the following script to know about the Windows Group in SQL Server

    DECLARE @LoginName sysname

    DECLARE @sql NVARCHAR (2000)

    BEGIN

    DECLARE cur_Loginfetch CURSOR FOR

    SELECT [name] FROM master.sys.server_principals WHERE TYPE = 'G'

    OPEN cur_Loginfetch

    FETCH NEXT FROM cur_Loginfetch INTO @LoginName

    WHILE @@FETCH_STATUS = 0

    BEGIN

    EXEC xp_logininfo @LoginName , 'members'

    FETCH NEXT FROM cur_Loginfetch INTO @LoginName

    END

    CLOSE cur_Loginfetch

    DEALLOCATE cur_Loginfetch

    RETURN

    END

    Sanz
  • Thanks a lot for your help, it solve my prob;

Viewing 3 posts - 1 through 2 (of 2 total)

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