I have a pandas dataframe that is dynamically created with columns names that vary. I\'m trying to push them to sql, but don\'t want them to go to mssqlserver as the defaul
You can create this dict dynamically if you do not know the column names in advance:
from sqlalchemy.types import NVARCHAR
df.to_sql(...., dtype={col_name: NVARCHAR for col_name in df})
Note that you have to pass the sqlalchemy type object itself (or an instance to specify parameters like NVARCHAR(length=10)) and not a string as in your example.