2

I am using CData Sync to convert my table in SQL Server to MariaDB. The data type I have for some of my columns (including my primary key) is nvarchar(255) and when I try to convert it using CData sync to a MariaDB table, it throws an error stating: #1170 error (42000) blob/Text Column Used in key specification without a key length. In the table mapping section in CData I see the column data types are being mapped correctly (nvarchar to varchar) but I think because the length on the source table is nvarchar(255) it's converting to varchar(510)? Which is too big so it's reading varchar as a TEXT/BLOB instead? None of my columns are specified as TEXT/BLOB so I'm not sure where CData Sync is getting that from. How do I convert nvarchar(255) to varchar? Would it be varchar(255) or varchar(512)?

3
  • Given the obtuse way SQL Server defines nvarchar, I'd suspect the varchar(510) is the solution that accounts for all the values possibly stored there. What character set do you have in these columns? What length of the 255 "byte-pairs" are you using? What character set is being used in mariadb as the conversion type? The conversion shows CData Sync is definately creating a blob/text column. Commented Dec 21, 2022 at 4:04
  • im not sure how to check the character set of the columns, but the coallition is "SQL_Latin1_General_CP1_CI_AS" for the SQL Server table and the max length of the characters used in the column thats erroring out in SQL Server is 30... Commented Dec 21, 2022 at 15:55
  • there is no table in MariaDB because of the error from replicating the original table Commented Dec 21, 2022 at 15:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.