Monday, March 19, 2012

Export wizard trouble exporting columns names to ragged file.

I’m using the Import\Export wizard to export the top 5 lines from a MS Sql table into a fixed format (“ragged”) file.But I want the first record to contain the column names of the exported fields so I selected the “Column names in the first data row” option of the “Choose a Destination” box. When I run the Package I get:

>>>

· Information 0x402090dc: Data Flow Task: The processing of file "C:\barkingdog\ExportWithheader.txt" has started (SQL Server Import and Export Wizard)

· Error 0xc0202095: Data Flow Task: Failed to write out column name for column "CustomerID".
(SQL Server Import and Export Wizard)

Error 0xc004701a: Data Flow Task: component "Destination - ExportWithheader_txt" (49) failed the pre-execute phase and returned error code 0xC0202095.
(SQL Server Import and Export Wizard)

>>>

When I de-select the “Column names” option, the package works fine.Other than manually, how can I et the column names in output file?

TIA,

Barkingdog

That's very strange. I'm racking my brains as to what might be the problem but I can't think of anything!

Is there any other clue as to what is the problem?

-Jamie

|||

The problem here is that when you include column names in the first data row, then you might need to modify the column width (for a ragged right file). For example, if you have a column CustomerID which is of type DT_STR(5), it will fail trying to write "CustomerID" in that space, which takes 10 characters. Use the Edit Transform button on configure Flat File Destination page of the Import Export Wizard to adjust the length specified for each fixed width column.

hope that helps.

|||

Ranjetta,

I thought that that could be the case but I haven't had a chance to test it.

I also have to test if the "Import" wizard, with "column names in first row", has the same issue. My impression is no and perhaps the Export wizard is not as forgiving as the Import one. I will check.

Barkingdog

No comments:

Post a Comment