February 14, 2012 at 5:32 am
Hi all,
We have implemented a new naming scheme which uses @mssql for all SQL Server user accounts and groups.
Ive just created a new SQL box and used the naming convention and cant log in.
When i create add account from AD in Security. It changes the @Username to _Username.
Does SQL by chance not allow @ in user names? Trying to find a info online but searchs are coming up short.
Thanks
February 14, 2012 at 8:17 am
I would never start a username with a special character. I can't find anything off the bat either, but it just seems like a pointless convention. Why was this implemented? I believe usernames can only contain letters, numbers, and very few special characters. _ is one, @ is not.
EDIT: User names CAN use the @ special character, but cannot start with it.
Jared
CE - Microsoft
February 14, 2012 at 8:20 am
Hi,
Not sure why they implemented it, but yeah it don't work in SQL,
Soon as i changed the group to MSSQLGroupName i was in and working.
Lesson learned!
Thanks for the reply 🙂
S
February 14, 2012 at 8:24 am
looks like a GUI data input tweak;
if you go straight to TSQL, you cannot create a ulogin or user that starts with @
you can create either for a login which contains the @ symbol though:
--fails at syntax check:
CREATE USER @BATMAN WITHOUT LOGIN
--works just fine.
CREATE USER BATMAN@BATCAVE WITHOUT LOGIN
select * from sys.database_principals --[BATMAN@BATCAVE]
Lowell
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply