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 2000 Forums
 SQL Server Development (2000)
 Data Truncates when importing excel sheet data

Author  Topic 

na2173
Starting Member

38 Posts

Posted - 2004-06-24 : 10:40:17
hi

I am importing a excel file into sql server developer edition. One of the columns in the excel file always gets truncated after 255 characters
Steps to upload the excel data
First i link the file using sp_addlinkedserver
Second use openquery to upload the data into a table.

Does any body knows why the data is getting truncated, or any one came across this situation.






Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-06-24 : 11:52:36
is the column in the destination table set to length 255??? I believe thats the default length.

Corey
Go to Top of Page

na2173
Starting Member

38 Posts

Posted - 2004-06-24 : 15:15:13
No the column length is set to varchar(1000)
Go to Top of Page

Pat Phelan
Posting Yak Master

187 Posts

Posted - 2004-06-24 : 17:52:51
I doubt very much if the data is being truncated going into the server. I think it is being truncated coming out of the server.

If you are using OSQL.EXE, add the -w3000 parameter (it is basically "free" in OSQL.EXE). If you are using Query Analyzer, press shift-ctrl-o to bring up the options, click the results tab, key in a good guess at the column (1000 in your case) into the Maximum Column Width control, then click Ok.

Re-run your query to see if the results are more gooder now!

-PatP
Go to Top of Page
   

- Advertisement -