Character coding for remote exec command on SQL Server

Viewed 57

I am preparing a table for run external command under mariadb on a remote SQL server instance:

DROP TABLE IF EXISTS `ExternCommand1`;
CREATE TABLE `ExternCommand1` (
`cmd` VARCHAR(255) CHARACTER SET 'utf8' NOT NULL flag=0 ,
`number` INT flag=1,
`message` VARCHAR(255) flag=2)
ENGINE=connect
TABLE_TYPE=odbc
CONNECTION='DSN=MSSQL;UID=111;PWD=111'
CHARSET = utf8
BLOCK_SIZE = 1
OPTION_LIST='Execsrc=1';

I am running remote command:

SELECT* FROM `ExternCommand1` WHERE`cmd` = CAST("INSERT INTO [DTB_INTERCHANGE].[dbo].[TestA] (ID, Tx) SELECT 15, N'ßÁȵ$€Ł'" AS VARCHAR(255) CHARACTER SET utf8);

I am find in remote table something completely different string: ßÃȵ$€Å. I am testing various others Character set, but I never got the same string in insert command. In my example there is no need to convert the string to UTF-8, but the samples command allows you to quickly test different encoding versions. If I use SSMS and insert the given string locally using an INSERT, everything is fine. When I AM N'ßÁȵ$€Ł' will replace to 'ßÁȵ$€Ł' results is A?AÄ?µ$â?¬A

Can anyone advise how to transfer all the above characters?

0 Answers
Related