Microsoft SQL Server's bulk copy utility

learn more… | top users | synonyms

0
votes
1answer
32 views

SQL Azure Migration Wizard - Duplicate Primary Key

Just did a test at migrating a 120gb database onto RDS using SQL Azure Migration Wizard Because we can't afford any downtime for "just" a test we ran the tool on the live database (meaning data was ...
1
vote
0answers
63 views

Export using BCP as ASCII text

I have a script that stores data in a temporary table to be exported by running BCP using xp_cmdshell. The trouble is that BCP insists on exporting the data in Unicode and I need it to be in ASCII. ...
0
votes
1answer
21 views

SQL BCP Utility Writing to SSMS Insead of .csv File

I have a stored procedure in SSMS call sp_testInventoryIssues as follows: USE [ADMIN] GO /****** Object: StoredProcedure [dbo].[sp_testInventoryIssues] Script Date: 06/19/2015 16:02:29 ******/ ...
0
votes
0answers
60 views

How to quote database names with spaces when using queryout with bcp?

I'm attempting to use bcp on Microsoft SQL Server 2000 to export a couple of columns from a large database table. The database names contain spaces. Here's an example that works that contains an ...
0
votes
1answer
191 views

How to avoid delimiter character in BCP export?

In my project, I need to use SQL 2008 BCP tool to export the result of a stored procedure into a fixed column width file. I used different approaches, but still couldn't get expected result. Things I ...
0
votes
0answers
1k views

BCP Errors: String data, right truncation; Unexpected EOF

OK... I give up. I have been struggling with trying to import a semicolon-separated file (field1;field2) with BCP for the past two days, but I only have been getting these errors: Starting copy... ...
0
votes
0answers
72 views

Best way to move sybase IQ table to Sybase ASE

I use bcp to copy Sybase IQ table to sybase ASE server. Actually bcp first creates some bulk file with extracdet sybase IQ table there, and after just loads that file to Sybase ASE. Is it the one and ...
0
votes
0answers
150 views

Export a varbinary column to file system using existing authentication

I want to export a varbinary column to a file system. I can use BCP command to export data from a varbinary column, which requires username and password being sent along with BCP command. I can use ...
1
vote
1answer
36 views

BCP did not preserve relational data

I developed a document tracking database and front end C#/.NET app on my local machine (SQLServer Express and VS Express). Once it was working and usable I had our IT branch install the database (SQL ...
1
vote
1answer
401 views

Header is added when exporting column of type image with BCP to files

I export a column of type image to files using this command: EXEC master..xp_cmdshell 'BCP "SELECT file_name FROM file_table WHERE id = 11 " queryout "C:\bcpdir\test.xml" -T -N' In SQL Management ...
3
votes
2answers
2k views

Bulk insert with format file: 0 rows affected

When using the BULK INSERT command in SQL Server 2008 it returns: (0 row(s) affected) I am using this command to carry out the bulk insert: BULK INSERT Test FROM 'C:\DataFiles\Tests.dat' ...
-2
votes
1answer
360 views

Errors keeping stored procedures through restore from backup [closed]

We are running SQL Server 2008 R2 on two identical servers. One, called LIVE, is our production environment. The other, called QA, is our dev enivornment. In order to check backup integrity and run ...
2
votes
2answers
209 views

SQL Server BULK INSERT

I have a file saved using BCP and I want to know the specification of the table of the database that it needs to be materialized on the database. Is that possible? Thanks
5
votes
1answer
7k views

Unable to open BCP host data-file error

Having problem using BCP via xp_cmdshell. I exported the table data to a file as .dat but when I try to import the file to a new table, I am getting the below error. The SQL Server service and the ...
1
vote
0answers
183 views

SQL Server BCP imports, but table still has 0 records

I ran the following command from the command line on SQLServer 2008 R2 BCP C4L.dbo.districts in C:\TEMP\districts.sdf -f C:\TEMP\districts_import.fmt -T' No errors were reported and it ran as ...
1
vote
1answer
1k views

Another BCP Export [Fail]ure

All, in SELECT Data Set Using Stored Procedure with BCP Error @Remus Rusanu provided a great solution to the problem. However, this evolved in to another problem: this BCP query now runs DECLARE ...
1
vote
3answers
2k views

SELECT Data Set Using Stored Procedure with BCP Error

All, I have a BCP export query. It is failing with the useless error mesage on BCP usage: usage: bcp {dbtable | query} {in | out | queryout | format} datafile [-m maxerrors] [-f ...
0
votes
2answers
2k views

xp_cmdshell bcp wont save file

EXEC xp_cmdshell 'bcp "SELECT lastconnectip FROM RF_USER.dbo.tbl_UserAccount" queryout "C:\test.txt" -T -c' The command above runs, the output: NULL Starting copy... 1000 rows successfully ...
1
vote
2answers
2k views

Database table data transfer between different servers using bcp.exe and mysqldump

I have 2 servers, both are exact clones of another, one is PRODUCTION live use and the other is strictly for backend DATAENTRY. Using MSSQL on two different servers I am using the following command ...
2
votes
1answer
1k views

BCP error near the keyword 'as'

I am new to using BCP but I am trying to extract data generated via a stored proc. This is a continuation of my original question which was a stored procedure with temp tables. This procedure has ...
3
votes
3answers
3k views

How to run bcp utility from root drive?

My machine does not have full SQL Server installed. The following distributable packages are installed on my machine:- Microsoft® SQL Server® 2008 R2 Command Line Utilities Microsoft® SQL Server® ...
5
votes
1answer
329 views

bcp database migration

I want one server to migrate the database to another server. On another server database already exists, then ist all the tables, but they are empty and I want to fill. For the filling, I want to use ...
4
votes
2answers
7k views

Minimum requirements to run Sql Server BCP.exe utility

I am working with a client who needs to do a data import to a remote SQL Server (2008) instance. The machine that the import will be done from cannot have SQL Server installed on it. Can the BCP.exe ...
11
votes
1answer
3k views

Optimising BCP performance for BLOB data

I'm the process of planning the live migration of a 2TB database to partitioned tables. The system is broadly speaking a document store, the majority of the space being allocated to LOBs of between ...
3
votes
3answers
3k views

How to import a varbinary(max) column with bulk import?

I have a varbinary(max) column that I need to bulk import. The data I'm putting into this column is a byte[] in C#. How do I format the data in the comma-delimited file used for bulk import? In ...
3
votes
3answers
5k views

bcp in of datetime type data results in an “Invalid date / time format”

I am familiarizing myself with the bcp utility, and I have a large table containing datetime data awhich I bcp out in several ways: native, character, delimited. I then bcp in to a truncated table ...
5
votes
2answers
2k views

BULK INSERT - best usage

I need to export 150 million rows of only int/bigint columns from one SQL instance to another. I am using BCP queryout to export the rows and BULK INSERT to import the rows to another table. I split ...