Can't connect Sqlalchemy with pymssql to SQL Server 2000

49 Views Asked by At

Using pymssql.connect it worked

import pymssql

conn = pymssql.connect("192.168.1.12", "sa", "123456789", "aa")
cursor = conn.cursor()
cursor.execute('SELECT * FROM Table2')
print( "all persons" )
print( cursor.fetchall() )

However, I want to use SQLAlchemy with pymssql and it does not work

import pandas as pd
import sqlalchemy
from sqlalchemy import create_engine

engine = create_engine("mssql+pymssql://sa:[email protected]/aa")
df = pd.read_sql_table('Table2', engine)
df

OperationalError: (pymssql._pymssql.OperationalError) (195, b"'schema_name' is not a recognized function name.DB-Lib error message 20018, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\n") [SQL: SELECT schema_name()] (Background on this error at: https://sqlalche.me/e/14/e3q8)

How can I connect this?

0

There are 0 best solutions below