Forum Discussion
SQL Server fails login with password having semicolon
- Jun 09, 2022
Hi ACarrera1971
It can help if you provide us with the queries you run, because the mind reading ability of some of us does not work well. When you have an issue, then first of all you should describe what you did and as possible provide the tool to reproduce the case.
In general BY DEFAULT there is no issue in using semicolon in password. You can use any UNICODE character as well and not just English - Note that "can" DONT NOT mean "should"!
USE master GO CREATE LOGIN [RonenרונןWithsemicolon;] WITH PASSWORD = '[PassWithsemicolon;AndHebrewעברית]'; GOThe above code uses semicolon and Hebrew characters and it run without any issue.
Note! It is highly recommend NOT to use special characters in the LOGIN name, but for password it is a good idea to do so, with that said using non-English characters is not recommended if you cannot confirm that you will have option to use such chars anyway and everywhere.
I can confirm that semicolon in the password actually worked as expected, I have been able to succeed on this after using direct scripts to set the pasword with semicolon.
I am now suspecting that the use of the SQL Server Management made me to set a wrong password in every attempt provoking the error.
Thanks again to everyone for your useful suggestions and comments.
- Ronen_ArielyJun 13, 2022MVP
Hi ACarrera1971
There is no issue using SSMS with such password! Remember my sample above?
Here I can use the SSMS GUI to connect the server using this complex LOGIN and password
Your conclusion is wrong
Note! When using SSMS you do not add quotation marks or parentheses to the password or username. The software already adds these automatically when sending the query to the server. so if you use [password] instead of password then you will get an error message.
- ACarrera1971Jun 13, 2022Copper ContributorHi Ronen,
I did not explain myself, the fact that I use SSMS made me go wrong because I did not check properly the password (after several tries in fact) so I wrongly concluded the fact that semicolon was not allowed as password. SSMS is ok but the fact it did not display the password (as it must do).
I can confirm that SSMS worked well at this point, it was entirely my fault, thanks for your time.- Ronen_ArielyJun 20, 2022MVPYou are most welcome and I am glad to hear that all was solved 🙂