Tagged Questions

The bcp utility is used to export data from Microsoft® SQL Server™ or SAP Sybase Adaptive Server Enterprise databases to a data file in a user-specified format. The Microsoft and Sybase versions have similar syntax, but can not be used interchangeably.

I have to generate individual format files for each table available in a database , i am running the below mentioned sample script individually in command prompt mode to generate format files . can ...

I'm running SQL Server 2008 R2 and trying to test out bcp in one of our databases. For almost all the tables, the bcp and bulk insert work fine using similar commands below. However on a few tables I ...

I'm struggling with bcp. If I run the following SQL
exec xp_cmdshell 'bcp "select a.displayname, a.samaccountname, a.mail, a.title, a.givenname, a.sn from web_repository.dbo.activedirectory a ORDER ...

In our organization while sending reports to our clients we use dynamic url in email (SQL Server Database Mail) which redirects user to our report download page. On clicking this URL user will be able ...

I have the following code which compiles and runs with results in the viewer in SQL Server but the output file does not get generated. I do know that BCP works on my server with simple SQL statements ...

I have requirement to run a SQL query on specific time daily and generate an output file. I'm already using bcp tool inside query to generate report. But, problem is, script is not generating output ...

I am trying to export data from SQL Express into a .CSV file, without having to ommit the columns that have Extra CR LF's in them. I can generate the .csv file but it won't import or parse properly ...

I want to run BCP from C# console application and be able to detect syntax, permissions or other errors returned by BCP into CMD. I tried ErrorDataReceived event but it seems to me that it does not ...

Please can anyone advise if there is a method which can be used to stop SQL Server's BCP bulk copy command creating a final carriage return and hence a blank line at the end of the file?
I have been ...

I have a query that I'm using to create an input file for another program. I'm trying to do the process using the bcp utility via an R script using the system command. The query is as follows (using ...

I am trying to migrate data from Sql Server to a Sybase 16.0 database using the .net DLLs supplied with the Sybase installation (Sybase.AdoNet4.AseClient.dll version 16.0.02).
To keep things simple I ...

I've got a couple of issues with bcp.
I'm trying to load data from a text file to Sybase ASE 16.0 . The DB is on my local machine (Win 7 64-bit).
I'm using this command:
bcp dbname.owner.TO_INTS in ...

I am trying to import a large number of delimited files using BCP.
How do I write a loop so that I can iterate through the files in the folder?
The data is pipe (|) delimited. Below is an example of ...

I was executing BCP command through exe and it stucks after copying 50000 rows.
I looked at some forums and got to know that if we use StandardOuputReader in code than its max limit of output is near ...

Hi I have a a sql 2000 database with a large number of scanned documents stored as pdfs and word documents stored in an image data type.
I need to export them to files.
I have written code to to do ...

I have a working but relatively verbose SQL script, which I want to run every night and save the results in a csv file. The SQL Server job scheduler, my preferred approach, seems unable to save the ...

I am currently trying to import a CSV file which contains Chinese characters into a SQLServer 2012 table. However, all Chinese Characters are stored garbled up and in gibberish.
I am aware that SQL ...

I am having a .dat file which I have to upload on my SQL Server 2012 database. The table is as follows:
Primary Key TAB_KEY(bigint, not null)
SESSION_KEY (varchar(32),null)
HIT_KEY(varchar(32),null)
...

I am using BCP in MSSQL for importing flat file data into table. File has line feed character (0A) as row separator.
I am using below bcp query to import file
bcp dbo.BCPTest in O:\BCPTest\test.txt ...

I am creating a very simple stored procedure to export the output of a query to a text file using BCP as shown below.
When I execute the SP from SQL Management Sudio, the results pane just sits there ...