2014-02-12 15 views
0

我有一個腳本從平面文件數據導入併合並它們。我每天有大約190,000行數據合併。與apostroph合併爲第一個字符

需要我30分鐘左右。現在我花了2個多小時。誰的名稱加入該公司一個新的人

't Hart 

給出的名字造成的麻煩

的錯誤是這樣的

Code: 0xC0202092
Source: Data Flow Task 1 Source - zuko_GLDAP_DUMP_csv [1]
Description: An error occurred while processing file "D:...\NameOfTheFlatFile.csv" on

data row 82396. End Error Error: 2014-02-12 05:00:41.61
Code: 0xC0047038 Source: Data Flow Task 1 SSIS.

Pipeline

Description: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Source - zuko_GLDAP_DUMP_csv" (1) returned error code 0xC0202092.
The component returned a failure code when the pipeline engine called PrimeOutput().

The meaning of the failure code is defined by the component but the error is fatal and the pipeline stopped executing.

There may be error messages posted before this with more information about the failure. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 05:00:01 Finished: 05:00:42 Elapsed: 40.235 seconds. The package execution failed. The step failed

於是我走進了文件,看名字( 't Hart)。

我做到這一點(而不是整個代碼)

MERGE person AS TARGET 
USING temp_person AS SOURCE 
ON (TARGET.per_pid = SOURCE.per_pid) 
WHEN MATCHED THEN 
    UPDATE SET 
    TARGET.[per_name] = SOURCE.[per_name] 
WHEN NOT MATCHED BY TARGET THEN 
    INSERT (
     [per_name] 
    ) 
    VALUES( 
     SOURCE.[per_name] 
    ); 

我怎樣才能解決這個問題?

謝謝您的幫助

回答

0

希望這有助於。

這有一個線索sql注入是解決方案btw的唯一方法。

USE [adventureworks2008] 
GO 

SET ANSI_NULLS ON 
GO 

SET QUOTED_IDENTIFIER ON 
GO 

CREATE TABLE [dbo].[name](
     [name] [nvarchar](25) NOT NULL, 

) ON [PRIMARY] 

GO 

select * from name 

insert into name values ('James ''t Hart ') 

SELECT REPLACE(name , '''', '''''') from name 
相關問題