I have a csv that has 3300 attributes/columns. I cannot afford to create the columns manually in AZ SQL DB. I am looking out ways to automatically do it using Python. Came across to_sql and SQL Alchemy but does not look like it is working.
Error; ArgumentError: Expected string or URL object, got <pyodbc.Connection object at 0x0000022429404440>
import pandas as pdimport pyodbcimport urllibfrom sqlalchemy import create_enginefpath = r"C:\Users\***\test.csv"df = pd.read_csv(fpath)#print(df.head(5))conn = pyodbc.connect("DRIVER={ODBC Driver 17 for SQL Server};Server=tcp:XXX.database.windows.net,1433;DATABASE=XXX;UID=XXX;PWD=XXX")#;Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;")engine = create_engine(conn)df.to_sql(name='test',con=engine, if_exists='append',index=False)