Trim before appointment write in SSIS?

I have a data stream where there is a database source and destination of a text file (delimited by pipe '|'). The database source collects the SQL query from the variable.

The problem is that if the size of the field in the DB field, the name and surname is 30 characters, I get the output as (a space represented by dots)

saurabh......................|kumar.......................

I need the fields to be cropped so that the actual output

saurabh|kumar

I have over 40 columns to write, and I would not want to manually insert RTRIMafter each column in my BIG SQL query :(

I must add that the source can have up to 50,000 lines. I was thinking about placing a script component between them, but processing each line can affect performance.

Any ideas?

+3
3

, , , - .

-, , , - CHAR NCHAR. VARCHAR NVARCHAR. , , .

VARCHAR NVARCHAR, , , . , , .

, SSIS, - . , . , " ".

script, . Derived Column. Derived Column , . , firstname lastname. .

Derived Column SSIS . firstname lastname

RTRIM(firstname)
RTRIM(lastname)

, , Derived Column, script. Derived Column, , .

+9

script ? , script .

MSDN: http://msdn.microsoft.com/en-us/library/ms345160.aspx

(?) script, .Net , .

, , , , .

, . , .

0

See this: http://masstrimmer.codeplex.com

It will trim lines using parallelism.

0
source

Source: https://habr.com/ru/post/1767502/


All Articles