Excel Export, 255 Char Truncation and Destination Column Definitions -
04-29-2005
, 05:11 AM
I have a DTS package which exports from a SQL table to an Excel
spreadsheet - nothing tricky so far. The (SQL Server) source table
contains several columns which have more than 255 chars of data. When I
created the destination worksheet in DTS Designer, I specified LongText
as the data type for the long columns and all was well. I added some
conditional formatting to the destination, and then I added a little
VBS code which copies the empty template destination worksheet into the
real destination workbook, updates the package source & destination on
the fly and runs the export task, and now all my data gets truncated at
255 columns.
Further investigation shows that if I look at the column definitions in
the template worksheet using the Destination tab of the "Transform Data
Task Properties" dialog box, it has "remembered" the LongText column
data types, but in the destination workbook (i.e. the workbook where
I've copied the template worksheet), the columns are all VarChar( 255
).
So what I really want to know is: where is Jet/Excel storing these
column definitions/metadata? It's not in the
DestinationColumnDefinitions collection, because that's empty, both in
Disconnected Edit and at runtime in the debugger...
This one is really getting to me as I'm looking at reverting to a pure
automation (not DTS) solution if I can't find a way around this, and so
far I've always been able to make DTS do what I want.
Thanks in advance...
Alasdair Cunningham-Smith
Running SQL 2000 SP3 |