Challenge:
Migrate a table in a MySQL database to a table in a database in SQL Server.
Problem 1:
A column of type “Text” on the side of MySQL.
Solution 1:
Create a column of type “Text”, in this case isn’t Unicode, in SQL Server table side.
Problem 2:
In the package, I cannot assign values to respective OutputBuffer column of type “Text” (source for SQL Server). The “ReadOnly error”.
Solution 2:
You should assign values to this type of columns as follows (You should change the encoding type!):
OutputBuffer..AddBlobData(Encoding.Default.GetBytes(“<SOME_STRING>”);
Problem 3:
How to read the contents of a “Text” column type (in MySQL side), returning a String?
Solution 3:
The following strategy should be used:
string str_notes = System.Text.Encoding.Unicode.GetString(Row.<COLUMN_NAME>.GetBlobData(0, Convert.ToInt32(Row.<COLUMN_NAME>.Length)));
I hope it helps and save you time
This is exactly an issue I must find more information about, appreciate the blog post.