I'm trying to fetch a table from MS SQL Server into Pandas but I get the error:
ProgrammingErro r: ('ODBC SQL type -151 is not yet supported. column-index=3 type=-151', 'HY106')
ProgrammingErro r: ('ODBC SQL type -151 is not yet supported. column-index=3 type=-151', 'HY106')
Code:
import pandas
import pyodbc
cnxn = pyodbc.connect("Driver={ODBC Driver 13 for SQL Server};"
"Server=localhost;"
"Database=AdventureWorks2012;"
"Trusted_Connection=yes;")
cursor = cnxn.cursor()
sql = cursor.execute('SELECT * FROM HumanResources.Employee')
df = pandas.read_sql(sql, cnxn)
cursor.close()
cnxn.close()
Comment