0

我正在尝试使用 MySQL Workbench 5.2.46CE 将数据库从 SQL Server 2008 迁移到 MySQL。在复制数据之前一切正常(步骤“批量数据传输”):

开始...
为数据复制
准备信息...为数据复制准备信息已完成
确定要复制的行
数...计算表中的行数...
wbcopytables.exe --count-only --passwords-from -stdin --odbc-source=Driver={SQL Server};Server=.\sqlexpress;Database=... ;User Id=... ;Password=... --table-file=...
错误:确定要复制的行数:+ 不支持的操作数类型:“NoneType”和“str”
失败

我真的不明白为什么我会得到这个,所以如果你们有任何想法...... :) (PS:我今天开始使用 SQL Server 2008 和 MySQL Workbench,所以我真的不知道它们是如何工作的)

编辑 2 - SQL Express 表 DDL(更新)

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
4

1 回答 1

1

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.

于 2013-03-06T14:55:04.870 回答