Migrate data from Python to SQL Server environment

Viewed 15

I have worked with a dataframe in Python Colab Notebook and now I want to migrate the data to SQL Server and get queries in the SQL Server environment. I mean for example copy the dataframe from Python and paste it into SQL Server. The task is working with both platforms, so I Do NOT want to use the pyodbc library. enter image description here

1 Answers
engine = sqlalchemy.create_engine(f'mssql+pyodbc:///?odbc_connect={connect_string}', fast_executemany=True)
with engine.connect() as connection: 
     df.to_sql(<table name>, connection, index=False)
Related