Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Excel source having more than 255 characters Expand / Collapse
Author
Message
Posted Friday, February 5, 2010 10:37 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, September 18, 2010 3:42 AM
Points: 12, Visits: 53
Hi,

I have my SSIS package importing data from excel source to table. My excel file can contain cell text of more than 255 characters.

When i import data directly from excel to table, it truncates data after 255 and ports only first 255 characters to table.

I need the complete text to be ported to table.

Any suggestions pls...

Thanks.
Post #860660
Posted Friday, February 5, 2010 10:57 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:45 AM
Points: 6,582, Visits: 8,859
by default, excel text fields have a max length of 255 when importing. If using larger than this, you'll need to set up that field as a memo and not a text.

Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
Post #860683
Posted Friday, February 5, 2010 11:07 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, September 18, 2010 3:42 AM
Points: 12, Visits: 53
Hi, Thanks for your reply. Please explain how to do that..
Post #860691
Posted Friday, February 5, 2010 4:26 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:45 AM
Points: 6,582, Visits: 8,859
itzmee (2/5/2010)
Hi, Thanks for your reply. Please explain how to do that..

Right-click your Excel Source, and select "Show Advanced Editor".
Go the the "Input and Output Properties" tab.
Expand the "Excel Source Output" node.
Expand the "External Columns" and "Output Columns" nodes.
Click on the appropriate column under "External Columns".
Change DataType to "Unicode Text Stream".
Click on the appropriate column under "Output Columns".
Change DataTYpe to "Unicode Text Stream".
Click "Ok".


Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
Post #860918
Posted Saturday, February 6, 2010 9:21 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, September 18, 2010 3:42 AM
Points: 12, Visits: 53
Hi,

I tried to do that. The datatype of External column is always getting reset to its original one. I am able to change only the datatype of Output column. Please help.
Post #861112
Posted Saturday, February 6, 2010 10:35 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, September 3, 2013 8:24 AM
Points: 1,240, Visits: 5,421
SSIS bases its datatypes on a sampling of the records (8 rows by default) from the Excel file. If none of the records in the sample are longer than 255 characters, you cannot set the field to memo.

You can change the sample size by changing the value of TypeGuessRows in the registry key for HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel.

Drew


J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
Post #861126
Posted Saturday, February 6, 2010 10:43 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, September 18, 2010 3:42 AM
Points: 12, Visits: 53
Hi, Thanks for the information. I tried it by placing my longest data in the second row. Even then i am not able to set the datatype of external columns to DT_NTEXT.

Post #861128
Posted Tuesday, May 18, 2010 12:50 PM


Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, June 17, 2014 12:21 AM
Points: 23, Visits: 278
Thanks so much...upping the TypeGuessRows value solved this annoying issue for me.
Post #923837
Posted Wednesday, May 19, 2010 11:45 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, June 10, 2014 10:39 AM
Points: 29, Visits: 269
Just thought I would share my two cents. I ran into the same problem when going from Microsoft Access to Microsoft Excel to SSIS. If you export to XML directly from Access, then you can get around a lot of issues with data types, field lengths, and so on. I had struggled with importing data from Excel to SSIS until I got the source Access from the client and did the export to XML which cut my problems down tremendously.
Post #924544
Posted Sunday, February 23, 2014 10:10 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, March 5, 2014 5:55 AM
Points: 6, Visits: 35
All,

I my opinion, this is a big bug by MS in SSIS. There is a very simple effective workaround that works bullet-proof. Never import directly from Excel. Open the Excel workbook and export the data to tab-delimited ASCII file(s). Even better, ask your providers to do the export to ASCII for you, and submit the ASCII file to you, so, you don't have to do it. Then, from SSIS, import from the tab-delimited ASCII file(s). From ASCII files, SSIS can import fields with thousands of chars, without a glitch. It really works. Try it!

Mike Vassalotti
Herndon Virginia - USA
Post #1544290
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse