Solved

SSIS: Flat File Data Source: Text qualifier (") blows up for lines with internal two double quotes

Posted on 2011-03-23
3
1,033 Views
Last Modified: 2012-05-11
I'm trying to import a .csv file whose author chose this quoting system: two double quotes are used internally to quote an item inside a field.  Example input file:
"Song Name", "Composer"
"Yellow Submarine","Beatles"
"Symphony no 94 ""Surprise""","Haydn"     <--- SSIS doesn't like ""Surprise""
I have these set:
    Format: Delimited
    Text qualifier: "

All rows import except the lines that look ""like this""

How can I get around this problem without writing C# to manually clean up those lines before I import using SSIS?

SQL Server is an enterprise-level data solution... there must be a built-in way to attack this problem.
0
Comment
Question by:ZuZuPetals
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Expert Comment

by:Barry Cunney
ID: 35200668
Add a Derived Column Transformation task
Set up 2 variables one to store "" the other to store ''
in the expression of Derived column do a REPLACE function something like this
REPLACE( [yourfield], @[User::q1], @[User::q2])

so as to replace 2 double quotes with 2 single quotes -
0
 
LVL 2

Author Comment

by:ZuZuPetals
ID: 35203192
Do you do that stuff before or after (or inside?) the "Flat File Source" component?
Thanks, but could you please provide more detail?
0
 
LVL 17

Accepted Solution

by:
Barry Cunney earned 500 total points
ID: 35205481
Hi ZuZuPetals,
You do that stuff in separate step between your flat file source and your destinatation
Derived Column is one of the Transformation Tasks in the Toolbox

Please see print screen with example


SSISDerivedColumn.jpg
0

Featured Post

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question