pyodbc

Anaconda 3 not installing pyodbc v5

Anaconda 3 not installing pyodbc v5 Question: I have installed Anaconda 3 which includes Python 3.9.16. When I install pyodbc in miniconda it is only version 4. I read it needs to be version 5 if Python is above 3.7. When I run my Python script it I get the message ModuleNotFoundError: No module named …

Total answers: 1

How to connect to a MS SQL Server 2019 on another machine with Python?

How to connect to a MS SQL Server 2019 on another machine with Python? Question: The MS SQL server I am trying to connect with is in another machine within my corporate network. Many laboratory external devices write on the SQL service without issues, so I know that the server is configured to accept external …

Total answers: 1

Cannot connect to Azure SQL from Azure functions

Cannot connect to Azure SQL from Azure functions Question: I am trying to send some data from an Azure function to an Azure SQL DB, it seems that the function’s underlying linux image does not have PYODBC driver 18. I am using a managed identity to connect and it worked fine earlier on a linux …

Total answers: 1

UPDATE row with ID in Azure SQL table with pyodbc (passing variables)

UPDATE row with ID in Azure SQL table with pyodbc (passing variables) Question: I am attempting to update an entire row with a specific ID in my azure SQL database using pyodbc. I currently have the below query but know that the syntax is not correct. def update_invoice(fullName, invoiceNo, date, address, description, total, invoiceID): cursor.execute("UPDATE …

Total answers: 1

Pyodbc.connect is not connecting with created login and user

Pyodbc.connect is not connecting with created login and user Question: Been stuck on this for a few days. Seen quite a few stack overflow posts on this which hasn’t resolved for me and read the microsoft and pyodbc docs also but seems like my issue on this may be niche and would like some help. …

Total answers: 1

How can I perform an UPDATE if EXISTS based on existing data in SQL Server

How can I perform an UPDATE if EXISTS based on existing data in SQL Server Question: I am pulling data from an application (via Python) and writing that data into a SQL Server database. My initial data loads, however I will need to UPDATE that data based on subsequent API retrievals from my Python script. …

Total answers: 1

Can't get full data from SQL Server with python

Can't get full data from SQL Server with python Question: I’m trying to get query as a xml data from mssql server with pyodbc. After query, im writing data to new xml file with unique name. Everything works fine to this point with small data. Problem is when i try to read data over 2037 …

Total answers: 1

Pass data to a varaible with pyodbc

Pass data to a varaible with pyodbc Question: I connected to a database and there are some datas in it. In here I print the name of the person whose id is 2 cursor.execute(‘Select Name from Customers Where Id = 2’) for row in cursor: print(row) The name of the person is "Alex" it this …

Total answers: 1

Sql Server SET TRANSACTION ISOLATION LEVEL READ COMMITTED does not appear to work with pyodbc

Sql Server SET TRANSACTION ISOLATION LEVEL READ COMMITTED does not appear to work with pyodbc Question: Short Summary I am running multiple sql queries (each committed separately) within one session via pyodbc. In a few queries we call SET TRANSACTION ISOLATION LEVEL SNAPSHOT;, begin a transaction, do some work, commit the transaction and then call …

Total answers: 2