dbTalk Databases Forums  

Looping on Bulk Insert...

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Looping on Bulk Insert... in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Richard Ferrara
 
Posts: n/a

Default 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

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.