SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Excel source having more than 255 characters


Excel source having more than 255 characters

Author
Message
itzmee
itzmee
Valued Member
Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)

Group: General Forum Members
Points: 74 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.
WayneS
WayneS
SSCrazy Eights
SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)

Group: General Forum Members
Points: 9924 Visits: 10573
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
Author - SQL Server T-SQL Recipes
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

itzmee
itzmee
Valued Member
Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)

Group: General Forum Members
Points: 74 Visits: 53
Hi, Thanks for your reply. Please explain how to do that..
WayneS
WayneS
SSCrazy Eights
SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)

Group: General Forum Members
Points: 9924 Visits: 10573
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
Author - SQL Server T-SQL Recipes
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

itzmee
itzmee
Valued Member
Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)

Group: General Forum Members
Points: 74 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.
drew.allen
drew.allen
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6296 Visits: 10871
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
How to post data/code on a forum to get the best help.
How to Post Performance Problems
Make sure that you include code in the appropriate IFCode tags, e.g. [code=sql]<your code here>[/code]. You can find the IFCode tags under the INSERT options when you are writing a post.
itzmee
itzmee
Valued Member
Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)

Group: General Forum Members
Points: 74 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.
SQLDuck
SQLDuck
Valued Member
Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)Valued Member (55 reputation)

Group: General Forum Members
Points: 55 Visits: 343
Thanks so much...upping the TypeGuessRows value solved this annoying issue for me.
jwmott
jwmott
SSC Journeyman
SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)SSC Journeyman (90 reputation)

Group: General Forum Members
Points: 90 Visits: 337
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.
Mike Vassalotti
Mike Vassalotti
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search