I am using Python and SQLAlchemy to query a database that I did not create.
I have run into a problem querying a table that contains the SQL_VARIANT
data type. I get the error:
sqlalchemy.exc.DBAPIError: (Error) ('ODBC data type -150 is not supported. Cannot read column Value.', 'HY000')
I confirmed with the database creator that the "Value" column is of type SQL_VARIANT
. Does anyone know a way to load this data type using Python? I am currently using mssql with pyodbc.
Thank you for any help you can offer!
Versions:
Python 2.7,
SQLAlchemy 0.7.8
SQL_VARIANT
so it looks to be a problem with the driver you are using to connect to the db. – davidism Jun 30 '13 at 18:08'mssql+pyodbc://user:password@IPAddress/database'
– Brett D Jul 1 '13 at 17:41mssql://user:pass@host:port/db?driver=FreeTDS&tds_version=7.2
. – davidism Jul 1 '13 at 19:27DRIVER={SQL Server};Server=IPAddress;Database=database;UID=user;PWD=password
. There is also the option of specifying a different driver as you have done. – Brett D Jul 2 '13 at 16:30