Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 exporting to excel

Author  Topic 

carumuga
Posting Yak Master

174 Posts

Posted - 2009-02-12 : 07:55:58
I have a data with varchar(5000) field called description, would like to export the data to an excel. Did anyone tried exporting data from oledb datasource to excel destination. I'm facing a hickups in performing such transformation - there is mismatch between unicode and non-unicode and tried to convert it using data conversion transformation but still i could not complete. Can someone come up with the concrete solution please.

Thanks in advance.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-02-12 : 09:42:27
yup. what you need is a data flow task with oledb source and excel destination with data conversion task in b/w.
something like this

http://www.mssqltips.com/tip.asp?tip=1393

Go to Top of Page

carumuga
Posting Yak Master

174 Posts

Posted - 2009-02-16 : 08:15:26
I tried with the "Import and Export wizard" to create a robust package, even that did not helped me, which created source->dataconversion->Destination. Is it limitation from Microsoft EXCEL 2002 as it could not take feed of more than 255 chars and the datatype is Unicode string [DT_WSTR]. The function of the Data conversion converts varchar(5000) to DT_WSTR (255) but still on running the package doesn't gave me a fruitful result (though i thought the package runs fine on truncation)

Error Msg: [Data Conversion 1 [35]] Error: Data conversion failed while converting column "ITEMDESC" (17) to column "ITEMDESC" (43). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".

Any help is really appreciated...
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-02-16 : 08:52:22
quote:
Originally posted by carumuga

I tried with the "Import and Export wizard" to create a robust package, even that did not helped me, which created source->dataconversion->Destination. Is it limitation from Microsoft EXCEL 2002 as it could not take feed of more than 255 chars and the datatype is Unicode string [DT_WSTR]. The function of the Data conversion converts varchar(5000) to DT_WSTR (255) but still on running the package doesn't gave me a fruitful result (though i thought the package runs fine on truncation)

Error Msg: [Data Conversion 1 [35]] Error: Data conversion failed while converting column "ITEMDESC" (17) to column "ITEMDESC" (43). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".

Any help is really appreciated...



Can't you increase the length of datatype while using conversion task?
Go to Top of Page

carumuga
Posting Yak Master

174 Posts

Posted - 2009-02-17 : 00:50:46
The destination Excel has the limit of DT_WSTR(255), is there any way to overcome this?
If you can try this, you may face hell lot of issues, i dont know it could be nightmare only for me.

I want someone who can try this scenario, create a table with attribute - varchar(5000) and try to export to excel.

Your help would be highly appreciated.
Go to Top of Page

carumuga
Posting Yak Master

174 Posts

Posted - 2009-02-19 : 00:56:51
Any help on this?
Go to Top of Page
   

- Advertisement -