批量插入在SQL Server CE [英] Bulk Insert In SQL Server CE

查看:229
本文介绍了批量插入在SQL Server CE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是在新的SQL Server CE和使用Visual Studio 2008,SQL Server CE的3.5。我想知道插入大容量记录到SQL Server CE数据库是什么是最好的方法是什么?请问 BULK INSERT 语句SQL Server CE的工作?我有近45表和一些这些表应该具有大的数据量。使用命令。prepare 就够了,还是有更有效和快速的方式?

i am new at SQL Server CE and using Visual Studio 2008, SQL Server CE 3.5. I want to know that what the best way of inserting bulk records into SQL Server CE database? Does BULK INSERT statement work for SQL Server CE? I have nearly 45 tables and some of these tables should have large amount of data. Using command.Prepare is enough or is there more efficient and fast way?

推荐答案

SQL CE不具有批量插入命令。为了获得最佳的原始性能打开一个可更新的<一href="http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlceresultset%28VS.80%29.aspx">SqlCeResultset使用<一个href="http://msdn.microsoft.com/en-us/library/system.data.commandtype%28VS.80%29.aspx">TableDirect <一href="http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.sqlcecommand.commandtype%28VS.80%29.aspx">SqlCeCommand是速度最快的赌注。它绕过查询处理器完全,实际上大约是尽可能快地直接写入到一个文本文件中。

SQL CE does not have a bulk insert command. For the best raw performance opening a an updateable SqlCeResultset using a TableDirect SqlCeCommand is your fastest bet. It bypasses the query processor altogether, and is actually about as fast as directly writing to a text file.

这篇关于批量插入在SQL Server CE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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