Home > Database > Mysql Tutorial > body text

T-SQL 使用链接库向mysql导数据遇到的奇葩事件一

WBOY
Release: 2016-06-07 17:37:02
Original
1091 people have browsed it

mysql表结构有 主键 非自增 text longtext类型字段多个 步骤 1、在T-SQL 临时表中处理好所有需要的字段 2、执行openquery语句 字段顺序完全按照mysql字段顺序插入 此时发现错误:Duplicate entry '0' for key 'PRIMARY' 经强哥指点,兑换主键字段和长类型字

mysql表结构有 主键 非自增 text longtext类型字段多个

步骤

1、在T-SQL 临时表中处理好所有需要的字段

2、执行openquery语句 字段顺序完全按照mysql字段顺序插入

此时发现错误:Duplicate entry '0' for key 'PRIMARY'

经强哥指点,兑换主键字段和长类型字段的位置,重新执行openquery语句

此时无错误发生,,但是查看mysql表内数据时发现当初执行openquery语句时第一个字段没有插入成功

究其原因,始终不解,为完成数据导入,只能折中在此基础上进行openquery的更新操作

现希望广大大神们有知其问题所在者,望不吝告知,吾在此拜谢!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!