Questions tagged [sqlbulkcopy]

Lets you efficiently bulk load a SQL Server table with data from another source.

The SqlBulkCopy class can be used to write data only to SQL Server tables. But the data source is not limited to SQL Server; any data source can be used, as long as the data can be loaded to a DataTable instance or read with a IDataReader instance.

Using the SqlBulkCopy class, you can perform:

  • A single bulk copy operation
  • List item Multiple bulk copy operations
  • List item A bulk copy operation within a transaction

Link to Microsoft Help Documentation: Microsoft SqlBulkCopy Documentation

964 questions
-1
votes
1 answer

Issue with inserting data from datatable to database in c#

I have a Gridview with 3 columns and I am adding empty row with the help of 'ADD' button. Now I am trying to insert the data entered in grid to my table. here is my code. SqlConnection con = new SqlConnection(ConfigurationManager …
nirmala
  • 39
  • 1
  • 1
  • 10
-1
votes
1 answer

SQL Bulk insert bit column

I have a column in the table Person IsApproved bit NULL, I have a class Person with below property bool? IsApproved { get; set; } When I try to bulk insert values in Person table with Person.IsApproved value set to null, it gives the below…
Aamir
  • 1
  • 1
  • 4
-1
votes
1 answer

CSV file doesn't upload - C# , Sqlbulkcopy

I have an issue where I am unable to upload a CSV file using C# sqlbulkcopy. C# code is correct, files are getting uploaded when in correct format. Tested it. Reason: These csv files, may be, are not in valid format. Please see pic below, here you…
Akshay
  • 1,412
  • 2
  • 17
  • 51
-1
votes
2 answers

SQL bulk copy with mapped columns

I am trying to bulk copy from one table to another by mapping the column names as the source and destination may not have same columns always. Source can have 8 columns and destination can have 10 .. I need to map the columns and bulk copy. Tried…
user1046415
  • 779
  • 4
  • 23
  • 43
-1
votes
1 answer

Importing large XML File into MSSQLExpress through Powerhsell

as the title sugests i have to import large (6GB) XML files into an SQLExpress server. Since this has to happen on a daily basis on the VServer itself and im not allowed to install more Software i'm limited to powershell (although upgraded to…
hellfiend
  • 108
  • 9
-1
votes
1 answer

SqlBulkCopy start index?

I have a table that i want to copy to another table using SqlBulkCopy, but in my destination table i have an ID. So like this: Source table variable1, variable2, variable3, variable4 Destination table ID, variable1, variable2, variable3,…
Zee
  • 51
  • 6
-1
votes
2 answers

SQL Bulk copy - insert default value

I have a c#.net application in which I need to insert the default value from application to sql server by using sql bulkcopy. Example: SqlColumnMapping("src_col1","dest_col1"); SqlColumnMapping("src_col2","dest_col2"); in "dest_col3", I would like…
Jayesh Tanna
  • 398
  • 5
  • 17
-1
votes
1 answer

how to search for multiple values in one excel sheet and copy it to another sheet

Good day I have a huge problem I have an online store and need to update products and prices I have an excel sheet with all of the current products online and recieved a new pricelist Now the problem is that Im dealing with over 5000 products and I…
-2
votes
1 answer

SQL Server and c# .net - split large table into two and bulk copying

I will be having a table in SQL Server 2008 that will hold millions of rows and the initial design will be: Code nvarchar(50) PK Available bit validUntil DateTime ImportID int The users can import 100,000 odd codes at a time which I will be using…
knappster
  • 401
  • 9
  • 23
-2
votes
2 answers

SqlBulkCopy and SQL Server trigger Issues

I have following code in my application. I use SqlBulkCopy to upload Excel data into a SQL Server table. Now, I have a trigger on that table. I have changed my existing code like this but I am getting an error. The error is Argument 1: cannot…
atc
  • 621
  • 8
  • 31
-2
votes
2 answers

How to make data from one table which is having large data in millions to another table in sql

I have a table with millions of rows. I need to insert data from this table into another table in the same database. How do I insert the data from one table to another table in bulk using sql query in SQL Server 2012.
prashanth
  • 7
  • 3
-2
votes
1 answer

SqlBulkCopy Wcf Rest Moving Data between 2 sql server tables

I am trying to move data from some tables from one sql server database to another sql server database. I am planning to write a wcf rest service to do that. I am also trying to implement this using SQLBulkCopy. I am trying to implement the below…
Kurkula
  • 6,386
  • 27
  • 127
  • 202
-2
votes
1 answer

Ignore duplicate record in csv file on sqlbukcopy via c#

i have table that have one column phoneNO primary key i want to upload csv file via sqlbulkcopy i have error that primary key not insert duplicate value so my question is how to ignore row if it's duplicate and other rows inserts in database
-2
votes
1 answer

How to copy and validate data from one table (all varchar) to another (typed) in C#?

[note: needs to be in code as can't use SSIS or similar] I need to bulk copy data from one database to another using C# and EF probably - though this isn't cast in stone. The problem is that the source data is all in varchar(max) and I want the…
BlueChippy
  • 5,935
  • 16
  • 81
  • 131
-2
votes
1 answer

How to copy a .out file to postgresql?

I have this file (warning: potentially unsafe file download site) that I need to insert into the database using Postgres and Java. Please download it and let me know how I can extract data from this file. I tried the copy command. For one, it did…
CodingInCircles
  • 2,565
  • 11
  • 59
  • 84
1 2 3
64
65