5
Vote

Cannot create logins containing a hyphen (-).

description

You are able to create a SQL Azure login that contains a hyphen but you are unable to then create a database login using the same username. I believe this is due to the CREATE USER statement in code not enclosing the username within square brackets.

comments

TysonNavarre wrote Sep 11, 2014 at 2:04 PM

I have the same problem with usernames with a "." in them.

wrote Sep 11, 2014 at 2:04 PM

wrote Sep 20, 2014 at 11:28 AM

JavedSaqib wrote Sep 20, 2014 at 11:29 AM

The fix is easy.

All places where the user name is uses, enclose with "[" and "]"

Example: DROP USER [" + username + "]"

ChristianPejrup wrote Feb 24, 2015 at 6:25 AM

I have submittet a codechange to address the issue with "-" i have not tested it for "." as that was not with in my scope, but as i just added the [ ] around the UserName and Login in the sql i think it will address both issues.

wrote Mar 11, 2015 at 9:36 AM