Questions tagged [bcp]

The bulk copy program `bcp` is a command line tool that can be used to export data from Microsoft® SQL Server™ or SAP Sybase Adaptive Server Enterprise databases to a data file in a user-specified format. bcp can also be used to bulk-load (=quickly import) data into the database server. The Microsoft and Sybase versions have similar syntax, but can not be used interchangeably.

The bcp utility copies data between an instance of Microsoft® SQL Server™ 2000 and a data file in a user-specified format

1159 questions
0
votes
2 answers

how to get test data from production to dev with least performance impact on prod?

Frequently we need to get some test data from our production sql server 2008 (non r2 enterprise) to our development sql server 2008 r2. Obviously when we do this data extract we want to have minimum performance impact on the production box. Which…
Gullu
  • 3,477
  • 7
  • 43
  • 70
0
votes
2 answers

BCP Utility

I need to have ability in my application to be able to export some data using the SQL Server BCP utitility. The machines where this utility would run would not have SQL Native Client installed on it, so BCP.exe won't be present by default. Can I…
Hamid Shahid
  • 4,486
  • 3
  • 32
  • 41
0
votes
1 answer

Getting the number of rows returned by a bcp query?

Please help!!! I'm executing the bcp query using C# application. Currently for finding no of rows returned by the bcp query I'm using a file reader to get the count from the file created as a result of bcp query, Is there a way to get the count as…
Umamaheswaran
  • 3,690
  • 3
  • 29
  • 56
0
votes
1 answer

Unable to update the table of SQL Server with BCP utility

We have a database table that we pre-populate with data as part of our deployment procedure. Since one of the columns is binary (it's a binary serialized object) we use BCP to copy the data into the table. So far this has worked very well,…
Jeremy Jarrell
  • 661
  • 1
  • 11
  • 20
0
votes
1 answer

SQL Server 2008 BCP export throws: NativeError = 945, Database cannot be opened due to inaccessible files or insufficient memory

I am trying to export to a CSV file using BCP like this: DECLARE @SQL AS VARCHAR(1000) DECLARE @CMD AS VARCHAR(8000) SET @SQL='SELECT * from Pondor.dbo.tblLD' SET @CMD = 'bcp "' + @SQL + '" QUERYOUT "' + @FILE + '" -c -t "," -U"UserA"…
Atomic Star
  • 5,427
  • 4
  • 39
  • 48
0
votes
1 answer

BCP for sybase using .net

It is possible to run bcp utility for sybase database from .net code? I want to insert around 10000 rows in database which i have read from file. So rather then doing normal insert which takes much time i want to convert the data in file to bcp…
Denish
  • 983
  • 1
  • 13
  • 20
0
votes
2 answers

Handling datetime with bcp and format file

I'm using bcp to import a flat file into an SQL Server 2005 database. I'm running into a problem with datetime fields. My format file field is specified as: My data file has dates…
dtc
  • 10,136
  • 16
  • 78
  • 104
0
votes
1 answer

BCP with non-printable Field terminators

Trying to import the EPF files from Apple using BCP. Apple use characters \1 and \2 as field and row terminators. Unforunately these don't appears to be supported as BCP / BULK INSERT field terminators, from the documentation: Note Only the t,…
russau
  • 8,928
  • 6
  • 39
  • 49
0
votes
2 answers

Does BCP Maintain order on insert

If I do a queryout for BCP is the order maintained when I insert using bcp to a new table?
Marty Trenouth
  • 3,712
  • 6
  • 34
  • 43
0
votes
1 answer

BCP issues - where am I going wrong here?

Someone changed the row and column delimiters in BCP files I was working with. Actually, clumn used to be |~ and row was deafult \n and didn'tneed specification. I can't seem to run BCP on the files now without an error. When I run this now with…
John Humphreys
  • 37,047
  • 37
  • 155
  • 255
0
votes
1 answer

SQL bcp from SQL fie

I save query in .sql file I need to call this query using bcp and execute it . any idea how to do that
AMH
  • 6,363
  • 27
  • 84
  • 135
0
votes
3 answers

Can't get windows task scheduler to run scheduled console application

I have a console app that uses two batch files to decompress a zip file, take the xls which was decompressed convert it to CSV and BCP the data into a SQL table. I'd like to schedule this console app to run once a day. I set up windows task…
zombie
-1
votes
1 answer

Speed up Linked Server Import

I have several processes that run nightly that imports data from a AS400 into SQL Server using Linked Server. Here is a sample: truncate table TABLENAME insert into TABLENAME ( BT_TID, BT_SEQ , BT_DES , …
-1
votes
1 answer

import IP2Location IP2LOCATION-LITE-DB5.CSV file to SQL server

I had a look to the IP2 Location database for SQL server 2019, BCP import or TSQL openrowset, Import Data wizard, all fail Had no luck with the FMT file as it's the wrong version, no problem I guess I will generate it using bcp…
Walter Verhoeven
  • 3,867
  • 27
  • 36
-1
votes
1 answer

BCP queryout hangs with READ COMMITTED transaction isolation

Using SQL Server 2016 and bcp version 14 My query returns about 16k rows and runs quickly to completion in SSMS with the default (READ COMMITTED) isolation level however if I try to save the output of the same query using BCP the tool hangs. If I…