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
 General SQL Server Forums
 New to SQL Server Programming
 dts help

Author  Topic 

black_pearl
Starting Member

15 Posts

Posted - 2006-05-17 : 03:32:22
hello,

i have imported this table to sql from excel.
the datatype are all nvarchar.
i wonder why those data in lognum column which are "3.10E+03" became null when imported in sql. pls help. how can i get the data without and not null?

model____________lognum_____________serial
CPL28U12_________3.10E+03_________5U0617T13624
CPL28U12_________3101E240327______5U0617T13625
CPL28U12_________3101E240327______5U0617T13626
CPL28U12_________3101E24032_______5U0617T13627
CPL28U12_________3.10E+03_________5U0617T13617
CPL28U12_________3.10E+03_________5U0617T13618


__black_pearl__

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-05-17 : 08:29:46
Possible reasons
-- The data in Excel can be of mixed types (varchar, numeric), but a column in a SQL server table has only one type.

-- Data in Excel may exceed the range of computer representation of SQL server table
eg. try in Query Analyzer :
select 3101E304
select 3101E305
select 3101E240327

Also in an Excel sheet type
3101E304 --> converted to numeric 3.101E+307
3101E305 --> be there as typed as text

Are all lognum in same format?
Are they there as numeric or text ?
Are these real data?
Do u want those to be considered as text or numeric (I think u cannot exceed some limits when storing as numeric) ?



Srinika
Go to Top of Page

black_pearl
Starting Member

15 Posts

Posted - 2006-05-17 : 19:43:29
how would i know what type they are in excel?

__black_pearl__
Go to Top of Page

black_pearl
Starting Member

15 Posts

Posted - 2006-05-17 : 19:59:23
in excel, i tried converting the data type of lognum into text, but it still became null when i transfered it to sql. what data type should i convert it to to be able to match up with nvarchar in sql?

thanks.

__black_pearl__
Go to Top of Page
   

- Advertisement -