Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have to import csv file, but some field contains null values in it.How to import such type of files in database table.

Please help.

Thanks in advance.

What I have tried:

I tried to I to import file using Bulk import statement , but I am getting an error of null values
Posted
Comments
Mohibur Rashid 8-Jun-18 1:18am    
What database ti be exact?
Akshay Gate 8-Jun-18 1:33am    
I have a table created with field as a varchar datatype
Maciej Los 8-Jun-18 3:21am    
Sample data, please...
Akshay Gate 8-Jun-18 3:28am    
I have created a table like follow:

Create Table Tracking1
(
OrderId_prefix varchar(10) NULL,
OrderID varchar(10) NULL,
CustID varchar(10) NULL,
custname varchar(100) NULL,
Shipdate varchar(50) NULL,
ShipName varchar(100) NULL,
trackingno varchar(100) NULL,
ProductId varchar(100) NULL,
Productname varchar(100) NULL,
ProductQty varchar(10) NULL
)

I am trying to import data like this..

order_id_prefix order_id customer_id customer_name ship_date ship_method_name trackingno product_id product_name product_qty
100 247323 D2C002 Donna Ryan 43258.57071 dhl_express TT12348 ES16265 16OZ ES - GEORGIA PEACH 1
100 247323 D2C002 Donna Ryan 43258.57071 dhl_express TT12348 BL2406 24OZ SOLC - BLUEBERRY CHEESECAKE 1
100 247323 D2C002 Donna Ryan 43258.57071 dhl_express TT12348 RS265 1.5oz Georgia Peach Room Spray 1
100 247848 D2C002 carolyn shaw 43258.57071 1stclass-tnt ES26197 24 OZ. ES - OLD TIME LEMONADE 1
100 247849 D2C002 Sharon Pendleton 43258.57071 1stclass-tnt ES16355 16OZ ES - BURLWOOD & OAK 1
100 247849 D2C002 Sharon Pendleton 43258.57071 1stclass-tnt FF135 1.5OZ FIREFLY - DARK VANILLA BEAN 1
100 247849 D2C002 Sharon Pendleton 43258.57071 1stclass-tnt FF04 1.5OZ FIREFLY - CINNAMON SPICE 1
100 247849 D2C002 Sharon Pendleton 43258.57071 1stclass-tnt RS323 1.5oz Caramel Applewood Room Spray 1
100 247849 D2C002 Sharon Pendleton 43258.57071 1stclass-tnt FF202 1.5OZ FIREFLY - SOOTHING COCONUT 1
100 247849 D2C002 Sharon Pendleton 43258.57071 1stclass-tnt ES16432 16OZ ES - BLACK AMBER PLUM 1
100 247851 D2C002 Debbie Pickvet 43258.57071 dhl_express TZ12351 ES24615 24 OZ. ES - HOME MADE BROWNIE 1
100 247851 D2C002 Debbie Pickvet 43258.57071 dhl_express TZ12351 ES24616 24 OZ. ES - BROWN BUTTER PISTACHIO 1
100 248112 D2C002 Jennifer Kline 43258.57071 1stclass-tnt EW275 MELT ES - BERGAMOT MIST 3
100 248112 D2C002 Jennifer Kline 43258.57071 1stclass-tnt EW276 MELT ES - CITRUS LAVENDER 3
100 248113 D2C002 Tamara Shurling 43258.57071 dhl_express TZ12353 EW631 MELT ES - RAIN DRENCHED STRAWBERRY 1
100 248113 D2C002 Tamara Shurling 43258.57071 dhl_express TZ12353 EW615 MELT ES - HOME MADE BROWNIES 1
100 248113 D2C002 Tamara Shurling 43258.57071 dhl_express TZ12353 EW322 MELT ES - BLUBERRY CAKE DONUT 1
Akshay Gate 8-Jun-18 3:29am    
Some tracking no's are null in that...I want to import the csv file with this scenario

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900