Jun 09 2022 10:01 AM
Jun 09 2022 10:01 AM
It looks like that SQL Server is not able to login when the password used contains a semicolon. I was able to create/update a user to the server defining the password with semicolon in it, however I am unable to login using such user, the system responds "Login failed for user XXXX. Error 18456". It is odd because I am able to set such password to the user.
Recently I have been working on a development to properly process semicolon as part of the password in the connection strings but now I found this issue. I wonder if I need to change some configuration in the server in order to resolve this error, could you help please? Maybe it is associated with the password policy?
Thanks in advance
Jun 09 2022 05:36 PM
Hi@ACarrera1971 -- What is the state code associated with the Error 18456? Also, can you run the query below to ensure that mixed-mode authentication is enabled on the instance? Take care.
SELECT CASE WHEN SERVERPROPERTY('isIntegratedSecurityOnly') = 1 THEN 'Windows-only authentication' WHEN SERVERPROPERTY('isIntegratedSecurityOnly') = 0 THEN 'Mixed-mode authentication' END AS AuthMode
Jun 09 2022 09:31 PM - edited Jun 09 2022 09:32 PMSolution
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עברית]'; GO
The 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.
Jun 09 2022 10:19 PM
@ACarrera1971 , if you are using ODBC then it's a known issue. The semicolon is the parameter separator and if its used in user name or passwrod it causes a login error.
There are some more characters, see
Jun 10 2022 12:53 AM
Thanks for your answer. The authentication mode of the server I was testing on is "Mixed authentication mode", in fact I am trying to login using a SQL Server user, do you think it plays a role with this issue?
Really I am creating the login and updating the password using the SQL Server Management Studio.
I have been also trying to login using the SQL Management Studio and the error code 18456 is returned in the popup, I assumed it was the regular incorrect password.
Jun 10 2022 01:00 AM
Jun 10 2022 01:12 AM
Jun 10 2022 01:50 AM
Jun 13 2022 04:03 AM
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.
Jun 13 2022 08:07 AM