0

I have SQL Server 2014 (v12.0.2000.8) and I want to auto update a table via panda dataframe.

As I understood, it can be done from sqlalchemy and looks something like this:

sqlalchemy.create_engine("mssql+pyodbc://<username>:<password>@<dsnname>")

Server is on my local machine and I have windows authentication (Windows 10 to be precise).

Can someone advice me which string should be used in this situation?

1 Answer 1

0

I have found an answer on following page (similar question) :

[https://stackoverflow.com/questions/24085352/how-do-i-connect-to-sql-server-via-sqlalchemy-using-windows-authentication][1] and string looks something like this:

sqlcon = create_engine('mssql+pyodbc://@' + 'server_name' + '/' + 'db_name' + '?trusted_connection=yes&driver=ODBC+Driver+13+for+SQL+Server')

After that we can use dataframe.tosql method to import from panda to MS SQL database.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.