I am running pandas 0.16 and sqlalchemy 0.99. I am using the pandas.DataFrame.to_sql() method, which relies on sqlalchemy, to export dataframes to a MS SQL Server database.
My question is: is there a way to generate a text file with only the SQL statements created by the to_sql method, to understand exactly what is going on under the hood?
I tried this: How to retrieve executed SQL code from SQLAlchemy
but I get some SQL statements mxied with lots of other information, whereas I would need SQL statements only.
I'd need it because to_sql is too slow (6 minutes for 11MBs of data!) so I'd like to understand what's going on. I'm afraid the pandas developers will say it depends on sqlalchemy, and viceversa!
Thanks!