MySql 5.6 到 MSSql server 2014 迁移:ExecuteReader 需要一个打开且可用的连接

MySql 5.6 to MSSql server 2014 migration : ExecuteReader requires an open and available Connection(MySql 5.6 到 MSSql server 2014 迁移:ExecuteReader 需要一个打开且可用的连接)
本文介绍了MySql 5.6 到 MSSql server 2014 迁移:ExecuteReader 需要一个打开且可用的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MySql: 5.6MSSql: 2014使用的工具: MySql 的 SSMA

MySql: 5.6 MSSql: 2014 Tools Used: SSMA for MySql

从 mysql 迁移到 mssql 时,表和视图的所有结构都已成功迁移.迁移数据时,数据被部分移动,出现以下错误.

While migrating from mysql to mssql, all the structures for tables and views were migrated successfully. While migrating data, data was moved partially and I got the following errors.

ExecuteReader requires an open and available Connection. The connection's current state is closed.; SQL Server cannot access the source table <table-name>

The connection has been disabled.

还有其他一些琐碎的问题,例如Column 'modified_on' does not allow DBNull.Value.",我通过编辑表结构手动修复了这些问题.

There were other trivial issues as well like "Column 'modified_on' does not allow DBNull.Value." which I have fixed manually by editing the table structure.

推荐答案

为了解决 Column 'modified_on' 不允许 DBNull.Value 问题,SQL Server management studio 不允许我编辑结构.为此,我必须按如下方式更改配置.

To Fix the Column 'modified_on' does not allow DBNull.Value issue, SQL Server management studio doesn't allow me to edit the structure. For that I had to change the configuration as follows.

打开 SQL Server 管理工作室 -> 转到工具 -> 选项 ->设计师并取消选中防止保存需要表格的更改再创造."

Open SQL Server management studio -> Goto Tools -> Options -> Designers and uncheck "Prevent saving changes that require table re-creation."

修复以下两个问题:

ExecuteReader requires an open and available Connection. The connection's current state is closed.; SQL Server cannot access the source table <table-name>

The connection has been disabled.

解决方案:

为 MySql 打开 SSMA -> 转到工具 -> 项目设置 -> 选择左侧菜单中的常规 -> 选择迁移 -> 在 Misc 部分中-> 以分钟为单位设置数据迁移超时 = 500

Open SSMA for MySql -> Goto Tools -> Project Settings -> Select General from the left menu -> Select Migration -> In the Misc section -> set data migration timeout in minutes = 500

为 MySql 打开 SSMA -> 转到工具 -> 项目设置 -> 选择左侧菜单中的常规 -> 选择迁移 -> 在并行数据迁移部分-> 将 并行数据迁移模式Auto 设置为 Custom 并将 Thread Count 从 10 设置为 5

Open SSMA for MySql -> Goto Tools -> Project Settings -> Select General from the left menu -> Select Migration -> In the Parallel data migration section -> set Parallel data migration mode from Auto to Custom and set Thread Count from 10 to 5

再次运行数据迁移.

希望对你有帮助.

这篇关于MySql 5.6 到 MSSql server 2014 迁移:ExecuteReader 需要一个打开且可用的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)