Import .csv file through SSIS Package without double Quotes - sql-server

SQL 2005
I am importing .csv file to SQL Table through SSIS Package !! On doing so, I am getting double quotes on every column header or field value !!
How to remove double quotes, while importing .csv file ???

The csv file is using the " as a text qualifier.
When importing you must specify inform SSIS of this.
See How to strip out double quotes from an import file in SQL Server Integration Services SSIS

Add " as the Text Qualifier when choosing the source (csv file)
http://twitpic.com/4k3ok8/full

Enter " double quotes as the Text Qualifier.

Related

How to import a .csv file with double quotes in column values to SQL table

I am trying to import the data from a .csv file to SQL table using SSIS data flow task. One row in my .csv file is like
Col1,Col2,Col3
1200,"ABC","Value is \"greater\" than expected"
While creating the Flat file connection, I have given Comma as Delimiter and " as Qualifier. And created a derived column (REPLACE(Col3,"\"","")) as the second step to remove \" from column3.
But as soon as I start running the package I get an error in the Flat file source itself as "Column delimiter for col3 was not found".
Can someone please guide me in solving this issue?
You may need to escape the slash too, try this please and let us know:
(REPLACE(Col3,"\\\"",""))

Handling Double Quotes when importing CSV file to SQL

I'm trying to import some CSV files into SQL using the SQL Server Import and Export Wizard. I came across an error where some of the values contained two double quotes at the end e.g. GIG L SHAPIRO GU A"". The Text Qualifier is already be set to ", so I'm not sure how to import these files.

Issue with commas in the column while exporting SQL Server query result to .csv file with double quotes the data is splitting up to next columns

I have an issue with commas in the column while exporting SQL Server query results to a .csv file. The data is splitting up to next columns with double quotes, using SSIS.
This is my sample data:
EmpId Location Dept
---------------------------
101 Nyc,AUS It,HR
102 Nyc,AUS It,HR
When exporting this data into a .csv using SSIS, the data is splitting next column though I used text-qualifier double quote (").
Any suggestions will be appreciated
You might want to use another column delimiter, such as ";" instead of "," when exporting it to .csv
When using text qualifier you have to make sure they are applied on the export also.
Open your .csv by notepad++ or any text editor and see if each Location-entry is surrounded by double quotes (")

Importing *.DAT file into SQL server

I am trying to import *.DAT file(as flat file source) into sql server using SQL server import and export wizard. It has DC4 as delimiter which is causing error while trying to separate the columns and their respective data and importing them in sql server.
Are there any setting changes to be made during the importing process?
If you don't have to use the wizard, you can script it like:
BULK INSERT [your_database].[your_schema].[your_table]
FROM 'your file location.dat'
WITH (ROWTERMINATOR='0x04' -- DC4 char
,MAXERRORS=0
,FIELDTERMINATOR='รพ'
,TABLOCK
,CodePage='RAW'
)
The wizard uses SSIS under the hood. Instead of executing it directly, chose CrLF as row delimiter, then chose to save it as file. Open the file and edit it using any text editor. It's a simple xml file.
It's not clear whether 0x04 is the column delimiter or the row delimiter. Assuming it's the row delimiter,
Replace all instances of
Delimiter="_x000D__x000A_"
with
Delimiter="_x0004_"
there're two instances: DTS:HeaderRowDelimiter and DTS:ColumnDelimiter
Save the file and execute it with a double clik or "Open with: Execute package utility". I tested the solution on my PC using an account with limited permissions.

Importing DAT file that contains double quotes within few fields

I'm using SQL Server 2014 Management Studio - Import and Export wizard to import a .DAT file into a SQL Server table.
However, while all of these records are text qualified with " double quotes, some of the field values have double quotes within them. SQL Server aborts the package every time it hits a row like that. Any solution?
"Field A"|"Field B"|"Field C"
"Value A"|"Another value "with" for B"|"Value C"

Resources