MySql 中是否有任何类类似于 Sql Server 2005 中的 BulkCopy 类 [英] Isthere any class in MySql that is like BulkCopy Class in Sql Server 2005

查看:47
本文介绍了MySql 中是否有任何类类似于 Sql Server 2005 中的 BulkCopy 类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想执行 Sql Server 2005 的 BulkCopy 类中提供的相同功能,但我在 MySql 中找不到相同的功能.是否有任何类在 Microsoft SqlServer 2005 的 Bulkcopy 类中执行相同类型的功能.

I want to perform same functionality that is provided in Sql Server 2005's BulkCopy Class, But I couldn't found the same in MySql. Is there any Class that is do the same kind of functionality in Bulkcopy class of Microsoft SqlServer 2005.

推荐答案

据我所知,没有,但您可以运行一些语句,类似于使用 TSQL 执行批量插入的方式.

As far as i know there isn't, but there is some statements you can run that are similar to the way you would perform a bulk insert using TSQL.

SqlCommand sql
sql.CommandText = "LOAD DATA INFILE '" + path + "' INTO TABLE att_temp FIELDS TERMINATED BY '\t' ENCLOSED BY '\"' LINES TERMINATED BY '\n'";

这种语法可能不太正确,因为我不需要使用它,但正在考虑如果我们决定将数据库打开到 more 而不仅仅是 SqlServer,我们将如何执行批量插入.

This syntax may not be quite right as I've not needed to use it, but was contemplating how we'd perform a Bulk Insert if we decided to open the database to more instead of just SqlServer.

这篇关于MySql 中是否有任何类类似于 Sql Server 2005 中的 BulkCopy 类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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