I am trying to connect to a sqlserver database and read my data into a data frame. This is my code below:
import pandas as pd
import sqlalchemy as sq
engine = sq.create_engine('mssql://ServerName/myDataBase?trusted_connection=yes')
df_sql = pd.read_sql_table("TableName",con=engine,schema="App")
I am getting this error message:
NotImplementedError: read_sql_table only supported for SQLAlchemy connectable.
I don't know if I am missing anything in the syntax to get this connection to read into a dataframe.
read_sqlinstead ofread_sql_table?create_engine()returns anEngineobject, specificallyclass Engine(Connectable, log.Identified), so it is a Connectable. And sincedf = pd.read_sql_table("team", con=engine, schema="dbo")works for me I must conclude that there's something else going on that OP isn't telling us.