批量插入在SQL Server CE批量、SQL、CE、Server

2023-09-02 11:54:34 作者:櫻花雨落

我是在新的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不具有批量插入命令。为了获得最佳的原始性能打开一个可更新的SqlCeResultset使用TableDirect 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.