RSSAmplifier

Richard Astbury's Blog · Nov 28, 2017

Bulk inserting data into SQL Server

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

Let’s say with have a simple table in SQL Server CREATE TABLE [ dbo ].[ test ]( [ Value ] [ varchar ]( 36 ) NOT NULL ) …in which we want to insert thousands of values (Guids) from a .NET application. One by one A naive approach is to insert one at a time, like this: public void OneByOne () { const string sql = "INSERT INTO [Test] ([Value]) Values (@Value)" ; for ( var i = 0 ; i < count ; i ++) {…

Read on /2017/11/28/sql-bulk-copy/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.