My csv file: empNo | empName one | John 2 | Robin 3 | Thomas since empNo is not in correct data type and it will not insert in stage table but rest do, Is there any way i can able to catch which line has error data
Try sSQL = " BULK INSERT EmpStageTable" sSQL += " FROM '" + FullPath + "' " sSQL += " WITH ( FIELDTERMINATOR = '|', ROWTERMINATOR = '\n' ) " sSQL += " ;select count(*) from EmpStageTable" Using cmd As SqlCommand = New SqlCommand(sSQL, cn) cmd.ExecuteScalar() End Using
I tried to count successful records and total records to find out number of records failed.. but it did not work in all scenarios.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)