Yoh
Yoh

Reputation: 316

MySQL Workbench migration from SQL Server 2008 to MySQL : ERROR: Determine number of rows to copy: unsupported operand type(s)

I'm trying to migrate a database from SQL Server 2008 to MySQL using MySQL Workbench 5.2.46CE. Everything works fine until the copy of the data (step "Bulk Data Transfer) :

Starting...
Prepare information for data copy...
Prepare information for data copy done
Determine number of rows to copy....
Counting number of rows in tables...
wbcopytables.exe --count-only --passwords-from-stdin --odbc-source=Driver={SQL Server};Server=.\sqlexpress;Database=... ;User Id=... ;Password=... --table-file=...
ERROR: Determine number of rows to copy: unsupported operand type(s) for +: 'NoneType' and 'str'
Failed

I don't really understand why I get this, so if any of you have an idea... :) (PS : I started using SQL Server 2008 & MySQL Workbench today so I don't really know how they work)

EDIT 2 - SQL Express Table DDL (updated)

CREATE TABLE [dbo].[S_OCivilite](
    [OCIV_Id] [int] IDENTITY(0,1) NOT N'',
    [OCIV_Code_Pan] [nvarchar](3) NOT N'',
    [OCIV_Intitule_Pan] [nvarchar](35) NOT N'',
    [OCIV_DateModif_Pd] [datetime] NOT N'',
 CONSTRAINT [PK_OCIV_Id] PRIMARY KEY CLUSTERED 
(
    [OCIV_Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [IX_OCIV_Code_Pan] UNIQUE NONCLUSTERED 
(
    [OCIV_Code_Pan] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

Upvotes: 0

Views: 3587

Answers (1)

apesa
apesa

Reputation: 12443

When moving from one DB to another you will always run into datatype conversion hurdles. In a nutshell you need to understand what table structures are in your source DB and how those map to the same structures in the target DB.All these SQL Databases support or should support ANSI SQL, the collective common aspect of SQL, however each DB vendor has procedural extensions and DDL that makes cross conversion interesting.

So reading your question you do not have SQL Server 2008, but SQL Express which is a "lite" version of SQL Server. Your error is saying that in reading a table to get the row counts it has found a datatype or an unsupported ddl statement and can't handle the typecasting.

I use MySQL workbench, but have not tried to migrate a full DB. You should look for settings that relax the typecasting or send everything into MySQL as a varchar and then have a subsequent ETL process correctly process and typecast the data. Or do a table at a time until you understand what it is truly complaining about.

If you can post the records or record it is complaining about or the table DDL from SQLExpress that would really help.

EDIT 1: Response to SQL DDL edit

I would first off suspect the Identity column in SQL Server. The MySQL corresponding Datatype should be AUTO_INCREMENT . You need to find the logs for Bulk loader. You should be able to set the level of logging and actually see what it is complaining about.

Upvotes: 1

Related Questions