Forum Discussion
Kadeabdul
Jul 14, 2023Copper Contributor
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
Jul 24, 2023Brass 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
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