Search

SUSER_SID() doesn't handle Windows group names longer than 63 characters by Jon Seigel

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 772267
Opened: 11/26/2012 12:48:14 PM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
(This only applies to groups, as the actual limit for the sAMAccountName field is 256 characters. Users have a much smaller limit of 20 characters for this field.)

I was originally using CREATE LOGIN with a new AD group (getting the familiar "Windows NT user or group '...' not found. Check the name again."), and traced the problem back to the SUSER_SID() function -- presumably the logic for converting a login name to a SID is centralized, and so affects more than just what I was trying to do.

I tested against many versions (2005-2012) and editions on both x86 and x64 with the same results.

Since it's taken this long for someone to hit this bug (I couldn't find another instance of it being reported), even if it doesn't end up getting fixed, please document the limit in BOL.
Details (expand)

Product Language

English

Version

SQL Server 2012 - Enterprise Edition

Category

SQL Engine

Operating System

Windows Server 2008 R2 (all editions)

Operating System Language

US English

Steps to Reproduce

1. Create the following two groups in Active Directory:

123456789012345678901234567890123456789012345678901234567890123
1234567890123456789012345678901234567890123456789012345678901234

2. Run the following code:

SELECT
    SUSER_SID(N'<your domain>\123456789012345678901234567890123456789012345678901234567890123'),
    SUSER_SID(N'<your domain>\1234567890123456789012345678901234567890123456789012345678901234')

Actual Results

0x01050000000...     NULL

Expected Results

0x01050000000...     0x01050000000...

Platform

 

Virtualization

 
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 1/3/2013 at 10:13 AM
Issue will be fixed in next major release.
Posted by Microsoft on 12/3/2012 at 2:43 PM
Hi Jon,

Thanks for pointing this out to us. We will have this bug fixed in the next major version of SQL Server.

Il-Sung Lee.
Sign in to post a workaround.