How do I prevent Excel from truncating data?

I am working to pull data from a SQL database.  In SQL Server 2005, I save the results as a CSV file (Version 2013).  Sometimes (no rhyme or reason) some of the data is truncated.

If I copy the data from the SQL Query Results and paste into Excel, the data is truncated

If I copy the data from the SQL Query Results and paste into word, the data is not truncated.

I have over 1/2 million rows to export into Excel and pasting into Word first is not a viable option.
lmfsAsked:
Who is Participating?
 
lmfsAuthor Commented:
We ended up finding a solution to this issue. ITSysTech helped us explore Excel a bit more for the solution. Using Excel 2016 ( which provided different options than 2013) we connected to our server that held the database. We then executed our SQL query from Excel and all of the text was captured. Thank you all for your assistance!

Excel Query Solution
0
 
ITSysTechSenior Systems AdministratorCommented:
It would be cleaner to import the data rather then paste it by going to the data tab in Excel and then chose "From text" and chose your .csv file.

1.JPG
0
 
NorieVBA ExpertCommented:
Is it a particular field, or type of field, that is being truncated?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
ITSysTechSenior Systems AdministratorCommented:
If he is able to copy and paste into Word without truncation then the .csv file should not be the issue. Unless he is coping directly from SQL.
0
 
lmfsAuthor Commented:
We are still having the issue, even if we use the Excel Data From Text Import as you suggested.
0
 
ITSysTechSenior Systems AdministratorCommented:
Okay, how are you exporting into a .csv file? Are you using SQL Server Import and Export Wizard or a SQL query?
0
 
AlanConsultantCommented:
Hi Imfs,

We need to work out at which point this is going wrong, and you have two steps currently (export from SQL to CSV, then import the CSV into Excel).

Is the data truncated upon export from SQL into the CSV file, or is it getting to the CSV file okay?

Thanks,

Alan.
0
 
lmfsAuthor Commented:
The data is truncated upon export from SQL into the CSV file.
0
 
ITSysTechSenior Systems AdministratorCommented:
What are the steps you are taking to export from SQL into the CSV file?
0
 
Rob HensonFinance AnalystCommented:
This is A long shot...

How long is the value in the cells that are getting truncated? A cell is limited to 32,767 characters. Would that be the problem???

Excel specifications and limits detailed here:

Excel specifications and limits
0
 
lmfsAuthor Commented:
We continued to explore further export options in Excel and arrived to our own solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.