[thelist] DTS transfer from SQL Server into mySQL text field

Mark Rees mrees at itsagoodprice.com
Tue Nov 1 04:37:53 CST 2005


> Mark Rees wrote:
> > I'm using DTS with ODBC 3.51 to send data from MSSQL Server 2000 into
mySQL.
> > Everything is working fine, but I am struggling with mySQL destination
> > fields of type text and mediumtext.
>
> Hi Mark:
>
> I think the problem you are having is between the limits on the fields.
>
> mysql supports varchar up to 255, while mssql supports up to 8000.
> if your mssql varchar field is bigger than 255, you need to send it to a
> mysql field of text or mediumtext if you wish.


Thanks for your response. I've left this on the back burner for a few days,
but am back onto it now. I am aware of these limits. The MySQL field is of
type "text", and the MSSQL field is also text. I can change either of these
at will, but nothing I do seems to make any difference. Inserting a string
like 'abc' gives null, and trying to insert the contents of the MSSQL text
field gives an error. The error log shows the line of data I am trying to
insert, and the field causing problems looks like this:

           1v      H
^   yXðy?^   D T S T r

Could this be a collation problem, perhaps?

This is the MySQL table:

CREATE TABLE `categories_temp` (
  `category_id` bigint(20) unsigned NOT NULL default '0',
  `name` varchar(30) NOT NULL default '',
  `description` text,
  `parent_category_id` bigint(20) unsigned NOT NULL default '0',
  `position` int(11) NOT NULL default '1',
  `seo_keywords` varchar(255) NOT NULL default '',
  `seo_description` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`category_id`)
) TYPE=MyISAM;

Thanks in advance

Mark





More information about the thelist mailing list