0

Given:

  1. c# WinForms application
  2. more than 1000 .txt, .pdf, .doc files
  3. SQL Server 2008 table

    create table docs
    (
        id int not null identity primary key,
        filename nvarchar(255),
        filecontent varbinary(MAX),
        filetype nvarchar(10),
    )
    

I know how to upload file by file using INSERT or MERGE, but it is a long operation.

How to effectively fast upload many files into the table?

7
  • Are you using ADO.NET or Entity Frame work or LINQ? Commented Jul 24, 2015 at 9:34
  • 1
    use SqlBulkCopy operation so that you can insert multiple records faster. Commented Jul 24, 2015 at 9:49
  • Ok, add your answer and I will mark it. Commented Jul 24, 2015 at 10:18
  • But the question is: how to read from source when SqlBulkCopy using? I understand if the source is another table but what if it is file directory ? Commented Jul 24, 2015 at 10:29
  • so in this case use DataTable in C# at source. Commented Jul 24, 2015 at 10:35

1 Answer 1

1

use SqlBulkCopy operation so that you can insert multiple records faster.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.