I created a test table to demonstrate my problem.
CREATE TABLE [dbo].[TestExport](
[F1] [char](5) NOT NULL,
[F2] [decimal](9, 0) NOT NULL,
[F3] [decimal](5, 2) NOT NULL,
[F4] [decimal](6, 2) NOT NULL,
[F5] [numeric] (9, 0) NOT NULL)
Insert into testexport select 'REC1', 1, 1, 1, 1
Insert into testexport select 'REC2', 2, 2, 2, 2
Insert into testexport select 'REC3', 3, 3, 3, 3
Insert into testexport select 'REC4', 4, 4, 4, 4
Insert into testexport select 'REC5', 5, 5, 5, 5
select * from testexport
Using SQL Server 2008, I click on the database, then Tasks, then export data
to start the SQL Server Import and Export Wizard.
I use the default "SQL Server Native Client 10.0: to access the source
database and select "Flat File Destination" for the output.
I give the output file a "csv" extension, format="delimited", text qualifier
= " (I enter a double quote in the field) and ask for the column names to be
in the first row.
Row delimiter is "{CR}{LF}" and column delimiiter is "Comma {,}"
The following is displayed:
Click Finish to perform the following actions:
Source Location : WDSAPPS07
Source Provider : SQLNCLI10
Copy rows from [dbo].[TestExport] to d:\temp\test.csv
The new target table will be created.
The package will not be saved.
The package will be run immediately.
Provider mapping file : C:\Program Files\Microsoft SQL
Server\100\DTS\MappingFiles\MSSQLToSSIS10.XML
The output files content is:
"F1","F2","F3","F4","F5"
"REC1 ","1","1.00","1.00","1"
"REC2 ","2","2.00","2.00","2"
"REC3 ","3","3.00","3.00","3"
"REC4 ","4","4.00","4.00","4"
"REC5 ","5","5.00","5.00","5"
Why do the numeric fields have quotes around them?
JK