bulkinsert

Sql server bulk insert/update vs MERGE in insert or update scenario

Hi. I need to find the best way to insert or update data in database using sql server and asp.net. It is a standard scenario if data exist it is updated if not it is inserted. I know that there are many topic here about that but no one has answered what i need to know. So my problem is that there is really no problem when you update/in...

Not able to import large flat file into SQL Server 2008 table

I have an 18GB flat file (40,000,000 records), with fixed column widths (no field terminators), which I would like to read into a SQL Server 2008 R2 table. In addition to the text file with the data, I was given an Excel document with the field names and lengths. There are 270 fields with 465 total characters per record (per row). Using ...

Bulk Insertion on Android device

I want to bulk insert about 700 records into the Android database on my next upgrade. What's the most efficient way to do this? From various posts, I know that if I use Insert statements, I should wrap them in a transaction. There's also a post about using your own database, but I need this data to go into my app's standard Android da...

multiple updates with a select?

i would like to write insert into tbl1(a,b) select 123, (select id from tbl2 where status=987) the problem is, only one row is inserted instead of many rows. How do i fix this? using Sqlite. ...

How to bulk insert data to mysql with python

Currently i'm using Alchemy as a ORM, and I look for a way to speed up my insert operation, I have bundle of XML files to import for name in names: p=Product() p.name="xxx" session.commit() i use above code to insert my data paser from batch xml file to mysql,it's very slow also i tried to for name in names: p=Produc...

Performance problem with Oracle BULK FETCH and FORALL insert

Hello, I am trying to copied records from one table to another as fast as possible. Currently I have a simple cursor loop similiar to this: FOR rec IN source_cursor LOOP INSERT INTO destination (a, b) VALUES (rec.a, rec.b) END LOOP; I want to speed it up to be super fast so am trying some BULK operations (a BULK FETCH, then a FOR...

SqlBulkCopy from a List<>

How can I make a big insertion with SqlBulkCopy from a List<> of simple object ? Does I to implement my custom IDataReader ? ...

How do I temporarily disable triggers in PostgreSQL?

I'm bulk loading data and can re-calculate all trigger modifications much more cheaply after the fact than on a row-by-row basis. How can I temporarily disable all triggers in PostgreSQL? ...

Delete All / Bulk Insert

First off let me say I am running on SQL Server 2005 so I don't have access to MERGE. I have a table with ~150k rows that I am updating daily from a text file. As rows fall out of the text file I need to delete them from the database and if they change or are new I need to update/insert accordingly. After some testing I've found that ...

Invalid character value for cast specification

I am inserting data into SQL 2005 using SQLXMLBulkLoad.SQLXMLBulkload.3.0 My data table has following column: objDataTable.Columns.Add("TaskDateTime", System.Type.GetType("System.DateTime")) My bulk insert schema has following definition: <xsd:element name="DepartureTime" type="xsd:date" /> (Using xmlns:xsd="http://www.w3.org/2001/XMLS...

xsd schema file must be annotated in SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class?

Here is an example to use SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class - [STAThread] static void Main(string[] args) { try { SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class objBL = new SQLXMLBULKLOADLib.SQLXMLBulkLoad4Class(); objBL.ConnectionString = "Provider=sqloledb;server=server;database=databas...

How do i load data Infile in multiple tables?

hi i run python program where im inserting many many new entries to database, this new entries are spread accross multiple tables. what is the quickest way to load them into database? at now im using something like this LOAD DATA LOCAL INFILE file INTO TABLE table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (col1, col2, c...

Bulk insert using stored procedure

I have a query which is working fine: BULK INSERT ZIPCodes FROM 'e:\5-digit Commercial.csv' WITH ( FIRSTROW = 2 , FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) but now I want to create a stored procedure for it. I have written below code to make its stored procedure: create proc dbo.InsertZipCode @filepath varcha...