none
Bug? Getting SQL70527 for CREATE USER

    Question

  • For a query such as this:

    CREATE USER [A\B] FOR LOGIN [A\C]

    SSDT issues the error

    SQL70527: 'A\B' is not a valid name because it contains characters that are not valid.

    However, SQL Server accepts and creates the user without issue.

    Monday, February 17, 2014 4:52 PM

Answers

  • Hi, this definitely looks like a bug. We're able to reproduce the behavior and have filed an internal product bug # 2079453 that will be triaged against our existing work items. Thanks for raising this,

    Kevin

    Monday, February 17, 2014 7:16 PM
    Owner

All replies

  • Hi, this definitely looks like a bug. We're able to reproduce the behavior and have filed an internal product bug # 2079453 that will be triaged against our existing work items. Thanks for raising this,

    Kevin

    Monday, February 17, 2014 7:16 PM
    Owner
  • Thanks!
    Monday, February 17, 2014 7:41 PM
  • Hello...

    Is there any fix for this bug?

    I have the same problem with the script:

    CREATE USER [BUILTIN\Administrators] FOR LOGIN [BUILTIN\Administradores];

    Error message:

    Error 326 SQL70527: 'BUILTIN\Administrators' is not a valid name because it contains characters that are not valid. 


    André P. Bertoletti

    Friday, May 23, 2014 6:29 PM
  • Hi, I'm digging into this a bit more and can't get SSMS to create the 'A\B' user either.  It appears that if you are using different windows principles, that is when you get the error.  I tried the example and SQL did not let me create the login with a ‘\’ that wasn’t a windows auth login.  Once I created the windows auth login, it gave me the same error when I tried to associate a user with a the different windows login.

    My SSMS example:

    Create login [domain1\ann] from windows

    Go

    Create user [a\b] for login [domain1\ann]

    Error:

    Msg 15006, level 16, state 1, line 1

    ‘a\b’ is not a valid name because it contains invalid characters

    Please let me know if you have additional information that shows this should work the way you are expecting with a mismatch of user and login using windows auth.

    Wednesday, July 23, 2014 11:34 PM
    Owner
  • Hi Andre, after spending some time investigating this issue it appears that this is by design, and that the same behavior reproduces in SSMS. The core issue is that in the "CREATE USER FOR LOGIN" based on a windows user login, if you are using a domain name for the user then this must match the login's domain name + login name. E.g. "CREATE USER [A\B] FOR LOGIN [A\B]" will work successfully, but  "CREATE USER [A\NotB] FOR LOGIN [A\B]" will fail. See http://msdn.microsoft.com/en-us/library/ms173463.aspx for the full documentation.

    I have closed the related bug as by design since it accurately models the engine behavior and the engine error message that's returned when you attempt to run this in SSMS. Thanks,

    Kevin Cunnane,
    SQL Server tools team

    Friday, January 16, 2015 10:55 PM
    Owner