using SSIS 2012. My flat file connection manager I have a delimited file where the row delimiter is set to CRLF
, but when it processes the file, I have a text column that has an LF
in it. This is causing it to read that as a row terminator causing it fail. Any ideas?
相关问题
- sql execution latency when assign to a variable
- What is the best way to cache a table from a (SQL)
- php PDO::FETCH_ASSOC doesnt detect select after ba
- Bulk update SQL Server C#
- SQL to Parse a Key-Value String
相关文章
- Entity Framework 4.3.1 failing to create (/open) a
- Code for inserting data into SQL Server database u
- SSIS solution on GIT?
- Delete Every Alternate Row in SQL
- Linux based PHP install connecting to MsSQL Server
- SQL Azure Reset autoincrement
- How do we alias a Sql Server instance name used in
- Is recursion good in SQL Server?
thank u for all the suggestions. turned out that the vendor had changed the encoding of the file from Ascii to unicode. changing the the package to read the correct encoding did the trick.
I have no SSIS experience but as an ETL developer I have faced this many times. So my suggestions might not help you solve the problem but hopefully point you in the right direction
Before answering, i don't think that the column contains only
LF
because if the row delimiter isCRLF
it will not consider it as delimiter. So it is probablyCRLF
, but i will give a solution for the two cases (CRLF or LF)Solution
You can fix this situation with the following steps:
DT_STR
and length4000
) so you will consider each row as one column.Simple Test
I will consider a flat file with the following content
In the DataFlow Task i will add a
Flat File Source
, 2 xScript Component
,OLEDB Destination
In the first Script Component i will mark
Column0
as input and i will add 5 output ColumnsID,Name,DOB,Notes,ClassID
and i will set the Output Synchronous Input asNone
In the first Script Component i will write a script that store each line in a memory variable and assign it to an output row when row is complete and another row is present.
In the second Script COmponent i will split each row into Columns
Important Note: the provided code is not optimal it may need more validations or can be simpler and better but i am trying to give you the way you can think to solve this issue
In your Flat File Connection Manager component you have a property that I forgot its name, in it you can set the row delimiter (
{CR}{LF}
,{LF}
,{CR}
, ...etc).Please try to adjust this property I think it'll work.