0

I have trying to load my pandas dataframe to my Azure Sql database using the library BCPANDAS. The problem I'm facing is that the bcpandas writes it to tables with Accents for string columns. I have tried multiple ways to over this but it doesn't seem to work for me. Things I tried: (i) When using BCPANDAS to write dataframes to database they store the file first as a csv which is then taken to load into the database (this is done in the backend of the code). So I wen to the module main.py of bcpandas which has a function df.to_csv and added into encoding='utf-8-sig' (changing from default 'utf-8'). Even after these changes the program isn't able to take these changes and keeps writing into database with strange characters.

Can someone please help me out on this as I'm pretty much lost here.

the out for the table here is like shown below with strange characters and accents:

Output table

The used is as follows:

`from bcpandas import SqlCreds, to_sql creds = SqlCreds( 'server', 'dbo', 'username', 'password' )

to_sql(df,'table_name',creds,index = False, if_exists='append')`

  • From the [bcpandas README](https://pypi.org/project/bcpandas/): "Bcpandas has been tested with all ASCII characters 32-127. Unicode characters beyond that range have not been tested." – Gord Thompson Jul 24 '23 at 14:21
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jul 24 '23 at 18:47

0 Answers0