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

SqlBulkCopy Tutorial - Knowledge Base (KB)

253 results in tag: sql-server

How does SqlBulkCopy retain row order?

I'm exporting data programatically from Excel to SQL Server 2005 using SqlBulkCopy. It works great, the only problem I have is that it doesn't preserve the row sequence i have in Excel file. I don't have a column to order by, I just want the records to be...
excel export import sqlbulkcopy sql-server
asked by roman m

What's the best technique to populate an extremely big table using SqlBulkCopy?

Nightly, I need to fill a SQL Server 2005 table from an ODBC source with over 8 million records. Currently I am using an insert statement from linked server with syntax select similar to this:...Insert Into SQLStagingTable from Select * from OpenQuery(ODB...
.net c# sqlbulkcopy sql-server vb.net
asked by Chad Braun-Duin

Does SQLBulkCopy significantly increase the size of the.mdf file?

I am using the SqlBulkCopy class to do a bulk insert into a SQLServer DB....Original size of the .mdf file associated with the DB is 1508 Mb.... When I run it (on the same data of about 4 million records) with :... BatchSize of 100000, the size of the .md...
sqlbulkcopy sql-server
asked by Pratik Stephen

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

What is the procedure for importing a table from an ODBC database?

I have an ODBC Database (some third party DB) where I have a bunch of tables. I am able to use 'GetSchema' to get a list of tables in there. I am also abe to utilize SQLBulkCopy to copy Data from these tables to SQL Server tables (only when I have created...
odbc sqlbulkcopy sql-server
asked by R D

SqlBulkCopy error while adding data

I'm trying to batch insert data into SQL 2008 using ...SqlBulkCopy.......Here is my table:...IF OBJECT_ID(N'statement', N'U') IS NOT NULL DROP TABLE [statement] GO CREATE TABLE [statement]( [ID] INT IDENTITY(1, 1) NOT NULL, [date] DATE NOT NULL DEFAUL...
ado.net c# datetime sqlbulkcopy sql-server
asked by abatishchev

When SQLBulkCopy is finished, count the rows.

I am using SQLBulkCopy to move large amounts of data. I implemented the notification event to notify me every time a certain number of rows have been processed, but the OnSqlRowsCopied event does not fire when the job is completed. How do I get the tota...
sqlbulkcopy sql-server
asked by SchwartzE

DataTables with a Parent/Child Relationship on the Identity Column and SqlBulkCopy

We have a need to update several tables that have parent/child relationships based on an Identity primary-key in the parent table, which is referred to by one or more child tables as a foreign key....Due to the high volume of data, we would like to build ...
.net c# sqlbulkcopy sql-server
asked by James Hugard

Using BCP, you may write from a SQL Server table to a file.

I just realized my caps was on from working in SQL Server, ha. ...Anyways, Im trying to write from ...serverName.databaseName.databaseInstanceName.TableName...to ...C:\FileName.xml...using ...bcp... and I want to write only columns ...Col1... and ...Col2....
command-line sqlbulkcopy sql-server
asked by tb.

How can I use an ODBC connection to conduct a SqlBulkCopy (equivalent) in C#?

I am working on a project where I need to extract data from a MSSQL database table, and then insert the data into a table of the same structure on an AS400....The SqlBulkCopy would be the ideal candidate for this operation, but fails (understandably) beca...
c# ibm-midrange odbc sqlbulkcopy sql-server
asked by Matt

Bulk SQL Server to Oracle Copy

I have a requirement for a project to move data from SQL Server to Oracle in bulk mode. There is OracleBulkCopy from DataDirect and ODP .net but to use that I have to first convert the data reader from SQL server into a CSV file and then can export that u...
oracle sqlbulkcopy sql-server
asked by Manav

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

Is it feasible to use SqlBulkCopy without the db datawriter permission in SQL 2008?

I want to limit my database possible access ways to only using stored procedures. Everything works fine except ...System.Data.SqlClient.SqlBulkCopy.... I'm using it only in one class for massive data import....Is it possible to avoid this problem?...I tri...
security sqlbulkcopy sql-server sql-server-2008
asked by abatishchev

In SQL 2008, which right allows a user to assign himself another right?

I need to grant a ...db_datawriter... before executing ...SqlBulkCopy... and remove it after:...try { "EXEC [db_mod].[sys].[sp_addrolemember] N'db_datawriter', N'my_user'" // via SqlCommand bulk.WriteToServer(table); } finally { "EXEC [db_mod].[s...
security sqlbulkcopy sql-server sql-server-2008
asked by abatishchev

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

Is it possible to utilize SqlBulkCopy without having to convert the data to a DataTable?

Is there a way to use SqlBulkCopy without converting the data to a DataTable? I have a list of objects (List) in RAM and I really don't want to use more memory to create the DataTable. Could it be possible to implement IDataReader on a List?...Thanks!
c# sqlbulkcopy sql-server
asked by Martin

Relationship between Client and Parent in SQL Bulkcopy

we have 2 DataTables in a .NET application having a Client / Parent relationship with millions of rows. This data should be inserted into a SQL Server database via SQL BulkCopy. It is possible that multiple instances of this .NET application run in parall...
.net sqlbulkcopy sql-server
asked by user115545

Multiple threads process a flat file in pieces using the producer/consumer pattern and SqlBulkCopy into a SQL Server database.

I hope you will bear with me. I wanted to provide as much information as I can. The main problem is how to create a structure (like a stack) that will be used by multiple threads that will pop a value and use it to process one big flat file and possibly ...
c# flat-file multithreading sqlbulkcopy sql-server
asked by Rad

For mass copy, go backwards.

I have an application that make a copy from my database by bulk copy class in c#....Can I rollback the bulk copy action in sql server when occur an exception?
bcp c# rollback sqlbulkcopy sql-server
asked by masoud ramezani

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

Page 1 of 13
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • …
  • »
  • »»

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!