bulkinsert

Bulk Insert with filename parameter [duplicate]

为君一笑 提交于 2019-12-17 16:27:22
问题 This question already has answers here : How to cast variables in T-SQL for bulk insert? (6 answers) Closed 6 years ago . I need to load a couple of thousands of data files into SQL Server table. So I write a stored procedure that receives just one parameter - file name. But.. The following doesn't work.. The "compiler" complains on @FileName parameter.. It wants just plain string.. like 'file.txt'. Thanks in advance. Ilan. BULK INSERT TblValues FROM @FileName WITH ( FIELDTERMINATOR =',',

Cannot bulk load. Operating system error code 5 (Access is denied.)

∥☆過路亽.° 提交于 2019-12-17 15:34:31
问题 For some weird reason I'm having problems executing a bulk insert. BULK INSERT customer_stg FROM 'C:\Users\Michael\workspace\pydb\data\andrew.out.txt' WITH ( FIRSTROW=0, FIELDTERMINATOR='\t', ROWTERMINATOR='\n' ) I'm confident after reading this that I've setup my user role correctly, as it states... Members of the bulkadmin fixed server role can run the BULK INSERT statement. I have set the Login Properties for the Windows Authentication correctly (as seen below).. to grant server-wide

Bulk Insert Sql Server millions of record

冷暖自知 提交于 2019-12-17 10:59:49
问题 I have a Windows Service application that receives a stream of data with the following format IDX|20120512|075659|00000002|3|AALI |Astra Agro Lestari Tbk. |0|ORDI_PREOPEN|12 |00000001550.00|00000001291.67|00001574745000|00001574745000|00500|XDS1BXO1| |00001574745000|›§ IDX|20120512|075659|00000022|3|ALMI |Alumindo Light Metal Industry Tbk. |0|ORDI |33 |00000001300.00|00000001300.00|00000308000000|00000308000000|00500|--U3---2| |00000308000000|õÄ This data comes in millions of rows and in

SQL Bulk import from CSV

若如初见. 提交于 2019-12-17 10:37:11
问题 I need to import a large CSV file into an SQL server. I'm using this : BULK INSERT CSVTest FROM 'c:\csvfile.txt' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) GO problem is all my fields are surrounded by quotes (" ") so a row actually looks like : "1","","2","","sometimes with comma , inside", "" Can I somehow bulk import them and tell SQL to use the quotes as field delimiters? Edit : The problem with using '","' as delimiter, as in the examples suggested is that : What most examples

How to insert multiple documents at once in MongoDB through Java

↘锁芯ラ 提交于 2019-12-17 07:22:15
问题 I am using MongoDB in my application and was needed to insert multiple documents inside a MongoDB collection . The version I am using is of 1.6 I saw an example here http://docs.mongodb.org/manual/core/create/ in the Bulk Insert Multiple Documents Section Where the author was passing an array to do this . When I tried the same , but why it isn't allowing , and please tell me how can I insert multiple documents at once ?? package com; import java.util.Date; import com.mongodb.BasicDBObject;

SqlBulkCopy from a List<>

依然范特西╮ 提交于 2019-12-17 04:54:26
问题 How can I make a big insertion with SqlBulkCopy from a List<> of simple object ? Do I implement my custom IDataReader ? 回答1: Simply create a DataTable from your list of objects and call SqlBulkCopy.WriteToServer , passing the data table. You might find the following useful: Adding columns to a DataTable. Add a column for each property/field you wish to write. Adding rows to a DataTable. Add a row for each object in your list. For maximum performance with SqlBulkCopy, you should set an

SqlBulkCopy from a List<>

大憨熊 提交于 2019-12-17 04:53:40
问题 How can I make a big insertion with SqlBulkCopy from a List<> of simple object ? Do I implement my custom IDataReader ? 回答1: Simply create a DataTable from your list of objects and call SqlBulkCopy.WriteToServer , passing the data table. You might find the following useful: Adding columns to a DataTable. Add a column for each property/field you wish to write. Adding rows to a DataTable. Add a row for each object in your list. For maximum performance with SqlBulkCopy, you should set an

mongodb: insert if not exists

此生再无相见时 提交于 2019-12-17 03:52:21
问题 Every day, I receive a stock of documents (an update). What I want to do is insert each item that does not already exist. I also want to keep track of the first time I inserted them, and the last time I saw them in an update. I don't want to have duplicate documents. I don't want to remove a document which has previously been saved, but is not in my update. 95% (estimated) of the records are unmodified from day to day. I am using the Python driver (pymongo). What I currently do is (pseudo

Bulk Insert to Oracle using .NET

依然范特西╮ 提交于 2019-12-17 03:35:29
问题 What is the fastest way to do Bulk insert to Oracle using .NET? I need to transfer about 160K records using .NET to Oracle. Currently, I'm using insert statement and execute it 160K times.It takes about 25 minutes to complete. The source data is stored in a DataTable, as a result of query from another database (MySQL), Is there any better way to do this? EDIT : I'm currently using System.Data.OracleClient, but willing to accept solutions using another provider (ODP.NET, DevArt, etc..) 回答1: I

Bulk Insert to Oracle using .NET

狂风中的少年 提交于 2019-12-17 03:35:02
问题 What is the fastest way to do Bulk insert to Oracle using .NET? I need to transfer about 160K records using .NET to Oracle. Currently, I'm using insert statement and execute it 160K times.It takes about 25 minutes to complete. The source data is stored in a DataTable, as a result of query from another database (MySQL), Is there any better way to do this? EDIT : I'm currently using System.Data.OracleClient, but willing to accept solutions using another provider (ODP.NET, DevArt, etc..) 回答1: I