Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7051545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:16:35+00:00 2026-05-28T03:16:35+00:00

I am using SQL Server Compact Edition. I have a FOR loop for build

  • 0

I am using SQL Server Compact Edition.

I have a FOR loop for build my queries to insert data so I download as 3000 rows from a full-blown SQL Server.

I need to insert these 3000 rows into SQL Server Compact Edition, and currently I do an insert for every row which takes a lot of time. I need to do this for 12 tables, and that would take a very long time… I need a faster method to do this in less than 5 minutes…

Do you know any way for to get a insert a lot of rows on SQL Server Compact?

I tried do insert of fifty on fifty but I got an ERROR…

insert into table(col1,col2) 
values (val1,valo2) ; 
insert into table(col1,col2) 
values (val1,valo2) 

I got error with 2 insert (so its not going to be able for to do 50 inserts),

Is it possible to do OPENROWSET in SQL Server Compact Edition?

MY QUESTION
How can I insert a lot of rows into a SQL Server Compact Edition database?
I get this data from a full-blown SQL Server database.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:16:35+00:00Added an answer on May 28, 2026 at 3:16 am

    do you know any way for to get a insert a lot of rows on sql compact?

    See below for what I think is the best solution, but if you don’t like it (for whatever reason) and your source database is SQL Server you could consider making a linked server in SQL Server to your compact database and letting SQL Server insert the records. From my experience, SQL Server inserts into arbitrary databases pretty quickly.

    SQL Compact Bulk Insert Library

    .NET Library for loading data fast (doing bulk inserts) into a SQL Server Compact database file. Attempts to mimic the SQLClient SqlBulkCopy API.

    Some timings from testing – load 2 column table with no constraints/indexes:

    1,000,000 rows: 6 seconds = 166,666 rows/second
    5,000,000 rows: 28 seconds = 178,000 rows/second

    private static void DoBulkCopy(bool keepNulls, IDataReader reader)
    {
        SqlCeBulkCopyOptions options = new SqlCeBulkCopyOptions();
        if (keepNulls)
        {
            options = options |= SqlCeBulkCopyOptions.KeepNulls;
        }
        using (SqlCeBulkCopy bc = new SqlCeBulkCopy(connectionString, options))
        {
            bc.DestinationTableName = "tblDoctor";
            bc.WriteToServer(reader);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method that pulls down data from a SQL Server Compact db:
I am using LINQ to SQL with Sql Server Compact Edition 3.5 and VS2008.
I'm new to SQL Server Compact edition. I'm using Compact edition 3.5. I tried
I am using x64 machine so if I embed SQL Server Compact Edition 4.0
Hey, I am using iBATIS with SQL Server Compact Edition 3.5 and try to
I have a SQL Server Compact Edition Database file, and I want to display
I have created a database in SQL server Compact Edition. I tried to attach
I am using the Entity Framework and SQL Server Compact Edition through the code
I'm using Microsoft's SQL-Server Compact Edition 3.5 in my C# application. The SqlCeConnection will
My company is looking at using SQL Server Compact Edition 3.5 as a datastore

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.