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 2005 Forums
 Transact-SQL (2005)
 SqlBulkCopy - Numbers are changed to NULL values.

Author  Topic 

karthi2009
Starting Member

23 Posts

Posted - 2009-08-05 : 08:14:46
Hi,

I am using SqlBulkCopy to import excel file data. The input excel file usually has 45+ columns and 40000 rows. Whenever I insert this data file into the Sql Server database, the column values such as 1.0.00, 2.0.00, 2.00 are randomly change to NULL values. This leads to wrong data retrieval.

Please suggest me in this regard,
Thanks in advance,


Karthikeyan

karthi2009
Starting Member

23 Posts

Posted - 2009-08-06 : 05:11:25
Hi,

I got it. The solution is obtained from the minor changes in the windows registry as in the following:

ImportMixedTypes: Majority Type
TypeGuessRows: 10000

This will allow to let save values without any value missing.

Thanks,
Karthik

Karthikeyan
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-08-06 : 05:15:44
Or change IMEX setting to import (text).
The reason the values are NULLs are that "1.0.00" cannot be treated as decimal.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -