• See inline in code section

    Paul White NZ (4/3/2010)


    isakhnov (4/3/2010)


    SUSER_SID returns the SID of test\userA and I'm looking at ways to retrieve the SIF matching the specified on a server login (test\groupB)

    From Books Online: "'login' is the login name of the user. login is sysname. login, which is optional, can be a Microsoft SQL Server login or Microsoft Windows user or group. If login is not specified, information about the current security context is returned."

    What does the following give you?

    SELECT SUSER_ID(N'test\userA'); -> sid of the windows user

    SELECT SUSER_ID(N'test\groupB'); -> sid of the windows group

    SELECT sid

    FROM sys.server_principals

    WHERE name IN (N'test\userA', N'test\groupB'); -> sid of the windows group only