Looping on Bulk Insert... -
01-09-2004
, 05:41 PM
I'm trying to loop through a series of files and bulk insert into the database. I set max errors to 999 but fails on the first one (Bulk Insert Data Conversion error (Truncation)). Anyway, I even tried setting batch sizes on the bulk insert task itself to 1, 10, 1000 - anything - still get the same error, it's just slower to get there!
Now I can datapump my way through this without issues, but I can't be as "dynamic" cause each file is different going into a different table.
Should I blow off using the Bulk Insert task and do bcp or datapump. Kind of a bummer here..
Thanks..
Richar
Set bulkSQLTablePG1 = pkg.Tasks("DTSTask_DTSBulkInsertTask_1").CustomTas
Set SQLTaskPG1 = pkg.Tasks("DTSTask_DTSExecuteSQLTask_1"
TaskDataFile = DTSGlobalVariables("gvWNBDir").Value & DTSGlobalVariables("gvImportFilePG1").Valu
bulkTextFilePG1.DataFile = TaskDataFil
'Supply the Destination Table for the Bulk Insert Task
TaskTableName = DTSGlobalVariables("gvSQLTablePG1").Valu
bulkSQLTablePG1.DestinationTableName = TaskTableNam
SQLTaskPG1.SQLStatement = "Truncate Table " & DTSGlobalVariables("gvSQLTablePG1").Valu
bulkSQLTablePG1.MaximumErrors = 999 |