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.
Author |
Topic |
bismarkcount
Starting Member
15 Posts |
Posted - 2007-12-10 : 17:25:10
|
Hello!!i need to upload a csv file to sql server, i am trying to load using bcp or bulk load, but the files has null columns, so i guess, that's why the program is displaying error.my table is as follows:PK COLUMN TYPE SIZE NULLABLE-----------------------------------------------PK Object_id int 4 NOSO varchar 4 NOFISY smallint 2 NOSegment_id varchar 3 NOSubSeg_id varchar 3 NOLine_id varchar 4 NOLevel smallint 2 NOType varchar 1 NOWWB_id varchar 3 YESSC_id varchar 6 YESPL_id varchar 9 YESPS_id varchar 12 YESPSS_id varchar 18 YESMaterial_id varchar 18 YESWWCC_id varchar 2 YESTHE OBJECT ID IS THE IDENTIFIER, SO IT SHOULD UPLOAD AUTOMATICALLYMY FILE IS SOMETHING LIKE THIS:SO FY SEG SUBS R NIV TIPO WWB SC PL PS PSS MAT WWCC4500 2008 100 110 R1 6 E 102 102120 102120159 102120159BBT 102120159BBT100111 300081 NULL4500 2008 100 110 R1 6 E 102 102120 102120159 102120159BBT 102120159BBT100111 300084 NULL4500 2008 100 110 R1 6 E 102 102705 102705453 102705453CIO 102705453CIO100282 300180 NULL4500 2008 100 110 R1 6 E 102 102705 102705453 102705453CIQ 102705453CIQ100284 300182 NULL4500 2008 100 110 R1 6 E 102 102705 102705453 102705453CIR 102705453CIR100285 300183 NULL4500 2008 100 110 R1 6 E 102 102120 102120167 102120167CIF 102120167CIF100255 300256 NULL4500 2008 100 110 R1 6 E 102 102705 102705453 102705453CJB 102705453CJB103026 300279 NULL4500 2008 100 110 R1 6 E 102 102705 102705453 102705453CIP 102705453CIP100283 300726 NULL4500 2008 100 110 R1 6 E 102 102120 102120167 102120167BED 102120167BED100249 300922 NULL4500 2008 100 110 R1 6 E 102 102120 102120164 102120164BDM 102120164BDM103231 301189 NULL4500 2008 100 110 R1 6 E 102 102120 102120159 102120159BBT 102120159BBT100114 301730 NULL4500 2008 100 110 R1 6 E 102 102443 102443542 102443542DFJ 102443542DFJ102704 301731 NULL4500 2008 100 110 R1 6 E 102 102705 102705453 102705453CIP 102705453CIP100283 301882 NULL4500 2008 100 110 R1 4 E 102 102120 102120167 102120167CII NULL NULL NULL4500 2008 100 110 R1 6 E 102 102120 102120159 102120159BBT 102120159BBT100111 302346 NULL4500 2008 100 110 R1 6 E 102 102120 102120159 102120159BBT 102120159BBT100111 302347 NULL4500 2008 100 110 R1 6 E 102 102120 102120159 102120159BBT 102120159BBT100111 302349 NULLthe first colums(identifier/object id) doesnt appear in the file, since it is supposed to be set automatically.the last column is a null value.Do you have any ideas??why is it displayiing me an error?which is the easiest way to upload the file??thanx in advance |
|
bismarkcount
Starting Member
15 Posts |
Posted - 2007-12-10 : 17:45:20
|
ok, i have solved thatjust added a comma in the beginning to insert the null value for the object id, and replaced the "NULL" words with nothing- "" |
 |
|
|
|
|