zzz projects SqlBulkCopy Tutorial
Documentation Troubleshooting
Knowledge Base
  • Documentation
  • Troubleshooting
  • Knowledge Base

SqlBulkCopy Tutorial - Knowledge Base (KB)

135 results in tag: sql

SqlBulkCopy from DataTable in SQL CLR

We have an in memory DataTable in a CLR procedure. After significant processing the DataTable has a lot of data that we need to load into a table in the database. Unfortunately, since we are using a ...context connection... SqlBulkCopy will not work (thr...
clr sql sqlbulkcopy sqlclr sql-server
asked by ahsteele

Loading a DataSet from SQL Server with table definitions and relations (but no data).

I'm not an expert with either System.Data nor SQL Server, but have a need to generate a large DataSet then use System.Data.SqlClient.SqlBulkCopy to store the results....The DataSet will consist of about 10 related tables. When SqlBulkCopy transfers the D...
.net sql sqlbulkcopy
asked by James Hugard

Before using SqlBulkCopy, truncate.

I want to truncate a table before doing a SqlBulkCopy. Does SqlBulkCopy automatically truncate a table before copying the data?
.net sql sqlbulkcopy
asked by Swami

SqlBulkCopy into composite primary key table

I'm trying to use SqlBulkCopy to insert new rows into my DB table by manually populating a DataTable w/in my application....This works fine for all tables ...except the table that has a composite primary key made up of 3 columns.... Whenever I try to Sql...
.net c# sql sqlbulkcopy sql-server-2005
asked by kamens

With nullable columns, how to utilize SqlBulkCopy

I’m having an issue using SqlBulkCopy when nullable columns are involved. It sounds like SqlBulkCopy doesn't know how to deal with nullable columns and throws an illegal size error when it encounters a zero length column. The error is ..."Received an in...
nullable sql sqlbulkcopy sql-server
asked by Chad

Before putting into the database, convert String to bit.

Can anyone help in converting string value in C# to bit equivalent in Sql. I'm trying to bulkcopy the values of a datatable into Sql table. All the values I've in the datatable are in string format. When I try to bulkcopy to SQL table I'm getting an er...
asp.net c# sql sqlbulkcopy sql-server
asked by vix

String conversion bug causes SqlBulkCopy to fail.

I have a view which generates a number of columns which I want to bulk load into another table which has identically named columns....This procedure worked fine when I was looping over the SqlDataReader and doing an insert with SqlParameters using a SqlCo...
.net sql sqlbulkcopy
asked by Tim Ebenezer

In SqlBulkCopy, get SqlDateTime overflow. WriteToServer()

I insert data from a typed dataset into my MSSQL database by using SqlBuldCopy class:...foreach (DataTable dt in ds.Tables) { using (SqlBulkCopy bulkCopy = new SqlBulkCopy(conn)) { bulkCopy.DestinationTableName = "dbo." + dt.TableName + "...
asp.net sql sqlbulkcopy
asked by Jack Black

When copying data in sql, add a column

I'm using SqlBulkCopy to bulk insert some records from one table into another table. The query is using a SqlDataReader to get the data. The one difference that matters (besides column order which is handled in the mappings) between the tables is that t...
sql sqlbulkcopy sqldatareader sql-server-2008
asked by nelsonwebs

Example of SqlBulkCopy WriteToServer. What am I doing incorrectly?

This might be long, but I want to explain my example...I got this Code:...#region [parent table] DataTable dtParent = new DataTable(); DataColumn dc; dc = new DataColumn(); dc.DataType = System.Type.GetType("System.Int32"); dc.ColumnName = "Id"; dc.Uniqu...
c# sql sqlbulkcopy sql-server
asked by Ash

From a typed List, create an IDataReader.

I have a ...List<MyObject>... with a million elements. (It is actually a SubSonic Collection but it is not loaded from the database). ...I'm currently using ...SqlBulkCopy... as follows:...private string FastInsertCollection(string tableName, DataTable ta...
c# linq sql sqlbulkcopy
asked by Jason Kealey

SqlBulkCopy's database engine independent counterpart

What is the best database engine independent way to load a huge amount of data....While I'm using SQL Server I use SqlBulkCopy but want to untie from SQL Server
database-independent sql sqlbulkcopy sql-server
asked by abatishchev

When there is no primary key, how can SqlBulkCopy prevent duplicate entries from being inserted?

I receive a daily XML file that contains thousands of records, each being a business transaction that I need to store in an internal database for use in reporting and billing. I was under the impression that each day's file contained only unique records, ...
c# sql sqlbulkcopy sql-server sql-server-2008
asked by kscott

On SQL Server 2000, SqlBulkCopy creates a deadlock.

I have a customized data import executable in .NET 3.5 which the SqlBulkCopy to basically do faster inserts on large amounts of data. The app basically takes an input file, massages the data and bulk uploads it into a SQL Server 2000. It was written by a ...
.net asp.net sql sqlbulkcopy sql-server
asked by stevenjmyu

Is it possible to recover PrimayKey IDs after a SQL BulkCopy?

I am using C# and using SqlBulkCopy. I have a problem though. I need to do a mass insert into one table then another mass insert into another table....These 2 have a PK/FK relationship....Table A Field1 -PK auto incrementing (easy to do SqlBulkCopy as str...
c# sql sqlbulkcopy sql-server-2005
asked by chobo2

How can I resolve this stored procedure issue?

I have 2 tables. The following are just a stripped down version of these tables....TableA Id <pk> incrementing Name varchar(50) TableB TableAId <pk> non incrementing Name varchar(50) ...Now these tables have a relationship to each other. ...Scenario...Us...
sql sqlbulkcopy sql-server
asked by chobo2

Is it possible to transfer data across servers using sql bulk copy?

Can I use sql bulk copy to copy data within the same server ?
sql sqlbulkcopy sql-server
asked by Relativity

In.Net, how can I bulk transfer sql (export) tables to csv or tsv files?

Are there any .Net libraries that provide a way of exporting sql database data to plain text files (i.e. csv\tsv)? SqlBulkCopy only applies to the import part of the solution and I prefer not to be calling any Process.Start calls to open up command prompt...
c# sql sqlbulkcopy
asked by JK.

Attempting to duplicate a row with significant content in an XML column using SqlBulkCopy fails.

I am trying to copy a record from one SQL Server table to another. Both tables have the same structure, one of the columns is of type xml. Source table has a large xml content in of the rows, about 2.5Mb....I saved the content of the xml column into a fi...
sql sqlbulkcopy sql-server xml
asked by stask

System is thrown by SqlBulkCopy. When using WriteToServer, a FormatException occurs (DataTable)

Currently I'm writing a method to read data from a CSV file and import to a SQL table.... DataTable dt = new DataTable(); String line = null; int i = 0; while ((line = reader.ReadLine()) != null) { Strin...
c# csv formatexception sql sqlbulkcopy
asked by Leo

Page 1 of 7
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • »

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!