0

This works fully as expected.

import pyodbc

connection = pyodbc.connect("DRIVER={ODBC Driver 17 for SQL Server};SERVER=localhost;DATABASE=test;UID=SA;PWD=<YourStrong@Passw0rd>", autocommit=True)

Why is this and what is going on?

However, when I try to connect with this connection string (I'm trying to setup Alembic) it does not work:

sqlalchemy.url = mssql+pyodbc://SA:<YourStrong@Passw0rd>@localhost/test?driver=ODBC+Driver+17+for+SQL+Server
RogerKint
  • 454
  • 5
  • 13
  • 1
    Does your password really have an `@` in it? – Gord Thompson Jan 19 '23 at 14:52
  • Can we assume from your [subsequent question](https://stackoverflow.com/q/75174220/2144390) that you were able to get Alembic to connect to your database? – Gord Thompson Jan 19 '23 at 15:20
  • Hi @GordThompson, I had missed your answer. But your suggestion was correct, I figured it out after a while and forgot to delete/answer this question. If you write it as an answer I'll accept it :). Do you know the answer to the my subsequent question perhaps? :P – RogerKint Jan 19 '23 at 15:24

0 Answers0