When using Power Automate flow to upload a CSV file to SQL server, the base64 value in the flow will be converted to a UTF-8 binary value if the target column data type is varbinary, or the raw base64 string value if the column data type is varchar/nvarchar.
However, when the original data contains unicode string value like Chinese character, the varbinary data type will not be able to be converted back to its original unicode text. Using the varchar/nvarchar data type to store the original base64 string value and then using following conversion to convert back to the original unicode text.
SELECT CONVERT(NVARCHAR(MAX),
CONVERT(XML,
'<?xml version="1.0" encoding="UTF-8"?>' +
CONVERT(VARCHAR(MAX),
CONVERT(XML, [Base64String])
.value('.','varbinary(max)')
)
)
)
FEATURED TAGS
ai
api
automation
azure
azure cosmos db
azure openai
azure vm
base64
dax
docker
excel
execution plan
hyper-v
infrastructure
m
machine learning
machine learning services
network
network card
performance
power automate
power bi
power bi report tricks
power query
powershell
python
qgis
query performance
regex
replication
snowflake
sql
sql script
sql server
sql server admin
sql server config
ssl
ssms
troubleshooting
unicode
vmware