Forum Discussion

Kadeabdul's avatar
Kadeabdul
Copper Contributor
Jul 14, 2023
Solved

How to escape a password containing a backslash \ in azure SQL server database connection string

Hello, I have a password that contains a \ and I tried to escape using a double backslash and it is not working. Anyone has another solution. Thanks

  • azharamir13's avatar
    azharamir13
    Brass Contributor
    you'll use a double backslash "\" to represent a single backslash in your password. Here's an example of how you can store a password with a backslash in a SQL Server database:

    Suppose your password is: "my\password" (with a backslash in it).

    You should insert it into the database like this:
    INSERT INTO Users (Username, Password)
    VALUES ('myusername', 'my\\\\password');

    Mark as Answer if it helps
    • Kadeabdul's avatar
      Kadeabdul
      Copper Contributor
      I got that resolved but I am still getting an error:
      There was an error while overriding 'Password' parameter because of 'SyntaxError: Unexpected number in JSON at position 8', make sure it follows JavaScript Object Notation (JSON)

Resources