SSMA MySql到MsSql空值错误 [英] SSMA MySql to MsSql Null Value Error

查看:129
本文介绍了SSMA MySql到MsSql空值错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MySQL包含一些日期时间为零的表:'0000-00-00 00:00:00'.使用SSMA将数据库迁移到MsSql时,我遇到有关无法插入DbNull的错误.这是可以理解的,因为MySql或MsSql都没有此字段可为空.

我不了解的是,我将SSMA的Default Projet设置更改为用恒定的所有零日期Not Null列替换.我选择的常数是:1900-01-01.

还有其他必须设置的设置吗?

我发现的唯一方法是进入MySql数据库,更改具有默认值(从零开始的日期时间)的每个表以允许为null.然后,我更新所有这些字段,以将基于零的值更新为null.从这里开始,使用ssma工具工作,因为它们不再是基于零的日期时间.这远非完美,但确实可行.

The MySQL contains some tables with some zero date time : '0000-00-00 00:00:00'. When using SSMA to migrate the database into MsSql I am facing the error about cannot insert DbNull. This is understandable since neither MySql or MsSql has this field nullable.

What I do not understand is that I changed SSMA's Default Projet setting to Replace with a constant all zero-date Not Null columns. The constant I choose is : 1900-01-01.

Is there any other settings that must be set?

解决方案

The only way I found is to go inside the MySql database, alter every table that is having a default value with zero based datetime to allow null. Then, I update every of these fields to update zero based value to null. From here, using the ssma tool work since their is no more zero based date time. This is far from being perfect but it works.

这篇关于SSMA MySql到MsSql空值错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆