I have non-english characters in one of the dataframe columns, pure strings previously retrieved from someone else's SQL Server database.
I want to insert those column into my SQL Server table which has column NVARCHAR(MAX)
. Every time I tried I got question marks there.
I thought solution could be converting dataframe string column to unicode string but not really understood how to do that.
Currently I don't do any modifications on string column and tried to put into SQL right away
data = ncon.list_tuples(value, value.columns.tolist())
query = "INSERT INTO ipm03_6010_85.dbo.Sales_SS VALUES{}".format(data)
to avoid selecting data in python also tried to make join directly on SQL Server but failed with it
SELECT DISTINCT product_id, code, sum(quantity) FROM dbo.Sales_SS GROUP BY product_id, code ORDER BY product_id ASC
LEFT JOIN (SELECT id, name FROM book.Products) as prods ON prods.id = product_id
also tried
df['name'] = df['name'].astype(str).unicode_string.encode(encoding='UTF-8',errors='strict') couldnt make it work
I want question marks to be gone and everything was stored correctly