Как поймать строку с данными об ошибках во время операции массовой вставки?
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.