bcp

Export blob from remote sql server and save to file on disk where sql server is located [C#]

余生长醉 提交于 2019-12-11 17:27:10
问题 What i Need to do: im working on a backup and restore tool for my Company. Backup remote SQL databases is done without any Problems. But i have Problems while restoring them. I'm currently creating a temporary table on the remote SQL where the binary of the database is saved. Now i Need to Export this binary field from a remote SQL Server to a file that Needs to be saved on remote disk too. This tool has the requirement to get started on local machine so there is no way of running it on

PCI IN slow with cluster index

与世无争的帅哥 提交于 2019-12-11 15:48:33
问题 We are working with ASE SYBASE 15.7 We have a huge historical table: 700 millions of records and one CLUSTER INDEX: c1,c2,c3,c4 with ALLOW_DUP_ROWS Every month we load 700,000 records en the table via BCP IN These records had a lot of duplicate records because fields: c2 and c3 had the same value for all records The time of BCP IN was 6 hours We changed the logical of INSERT's in the monthly table and now all of fields of CLUSTER INDEX: c1,c2,c3,c4 are diferents. After this change, the BCP IN

Any specific problems running (linux) BCP on “too many” threads?

非 Y 不嫁゛ 提交于 2019-12-11 15:44:23
问题 Are there any specific problems with running Microsoft's BCP utility (on CentOS 7, https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-migrate-bcp?view=sql-server-2017) on multiple threads? Googling could not find much, but am looking at a problem that seems to be related to just that. Copying a set of large TSV files from HDFS to a remote MSSQL Server with some code of the form bcpexport() { filename=$1 TO_SERVER_ODBCDSN=$2 DB=$3 TABLE=$4 USER=$5 PASSWORD=$6 RECOMMEDED_IMPORT_MODE=$7

SQL Server BLOB image column - extracting with BCP queryout - corrupted files AND bug

余生颓废 提交于 2019-12-11 12:51:18
问题 I need to export pdf and image files from a column in SQL Server 2012. Jonas's 3-step process in "How to export an image column to files in sql server" is the clearest instruction I've found. I did everything exactly as he stated. Two notes: Where he says "your_db" in the BCP statement, you need database_name.schema_name.table_name. No line breaks are allowed. I was able to export files one at a time after this, but they were corrupt. The files were slightly smaller (by 1-15 KB) than the

Fast dump SQL Server Table

只愿长相守 提交于 2019-12-11 11:56:49
问题 I have a big table in SQL Server 2008 R2. It contains billions of rows. I need to load the whole data set in our application. Query the whole table is very slow. I want to use bcp dump it into a file and load it. But the problem is there are string columns it contains all kinds of special characters like '\t', '\0', comma, and '\n'. I can't find a good field/row terminator. But long string terminator slows down the data file loading for my application. The question is: Is there any API that

BCP fails to export with error “Unable to resolve column level collation”

Deadly 提交于 2019-12-11 09:06:48
问题 I've thoroughly searched Stack Overflow as well as many other resources but still have an issue. Here's my export script, running under Cygwin: #!/usr/bin/env bash #-*- coding: cp1255; -*- bcp "declare @billing_types table(k int null, t varchar(14) collate SQL_Latin1_General_CP1255_CI_AS) insert @billing_types values (null, 'לא פעיל') ,(1, 'אשרי') ,(2, 'צ׳ק') ,(3, 'הוראת קבע') declare @standing_order_status table(i int null, s varchar(14) collate SQL_Latin1_General_CP1255_CI_AS) insert

Can't identify reason for BULK INSERT errors

孤街醉人 提交于 2019-12-11 02:38:58
问题 I'm trying to run this query (I also tried it without specifying FIELDTERMINATOR and ROWTERMINATOR). It's using a datafile that I am manually creating beforehand (not with bcp out). BULK INSERT FS.dbo.Termination_Call_Detail FROM 'C:\Termination_Call_Detail__1317841711.dat' WITH ( FORMATFILE = 'C:\Termination_Call_Detail__update_TerminationCallDetailData.fmt', FIELDTERMINATOR = '\t', ROWTERMINATOR = '\r\n' ) The errors I'm getting: Server message number=4864 severity=16 state=1 line=1 server

BCP Syntax issues

僤鯓⒐⒋嵵緔 提交于 2019-12-11 00:16:12
问题 All, I'm trying to write a query that I can run daily from a batch file on a SQL server 2008 instance. I've never used BCP before but after looking at some examples online, I've tried to create a real basic query to test the process & permissions on the machine before I look to widen the select query to the required dataset. I'm using: bcp "SELECT manifest_dt from EasyShip_050300.airwaybills" queryout C:\Shares\DHL-EXPORT-TEST\file.txt -SGRENSON-CARRIER\DHLEASYSHIP -c -T It appears to match

Why did Boost's `bcp smart_ptr dir/` copy 6MB of source code?

不羁的心 提交于 2019-12-10 19:11:48
问题 So I wanted to separate out just the smart pointers from boost to use in my project and I was guided to use bcp utility. Today I got it compiled and did bcp smart_ptr to_copy_to_my_project/ . The result: 6MB of code in to_copy_to_my_project/ directory. Are you kidding me? I don't want to add 6MB of header files to my 100KB project just to use smart pointers. For example, it copies the following win32 stuff (I am on Linux): Copying file: boost/thread/win32/basic_timed_mutex.hpp Copying file:

SQL Server BCP export binary to file: extra data at the begining of the file

冷暖自知 提交于 2019-12-10 17:43:18
问题 I tried to use xp_cmdshell with this BCP: 'BCP "SELECT TOP 1 Data FROM <FQDN> WHERE Name = ''<name>'' " queryout "C:\exportdir\export_data.dat" -T -n -S .\SQLEXPRESS' But I'm getting some extra data at the begining of the file buffer. I tested it twice and both files started with BB 67 B9 00 00 00 00 I'd like to get rid of this, I tried to replace the -N parameter both with -n and -w but no luck. 回答1: To do this you need to run the export with a format file that specifies a prefix length of 0