Hi,
Could any body tell me what is the problem?
I wrote a DTS application which will download a large file (about 100M) and
bulk insert many records into the database (about 300'000 each time), when
calling the Package.Execute method, the program sounds no response though
the records are inserting to the DB at that time.
Here is some of my code (Delphi, DTS FTP Task):
goPackageOld := CreateOLEObject('dts.package2');
goPackage := goPackageOld;
goPackage.Name := STR_FTP_PACKAGE_NAME;
goPackage.Description := STR_FTP_PACKAGE_DESC;
goPackage.WriteCompletionStatusToNTEventLog := True;
goPackage.LogFileName := Global.gDTSLogFile;;
goPackage.FailOnError := False;
goPackage.PackagePriorityClass := 2; // Middle priority
goPackage.MaxConcurrentSteps := 4; // Paralell exe max number
goPackage.LineageOptions := 0;
goPackage.UseTransaction := True;
goPackage.TransactionIsolationLevel := 4096;
goPackage.AutoCommitTransaction := True;
goPackage.RepositoryMetadataOptions := 0;
goPackage.UseOLEDBServiceComponents := True;
goPackage.LogToSQLServer := False;
goPackage.LogServerFlags := 256;
goPackage.FailPackageOnLogFailure := False;
goPackage.ExplicitGlobalVariables := False;
goPackage.PackageType := 0;
//'----------------------------------------------
//' create package steps information
//'----------------------------------------------------------------
//'------------- a new step defined below
oStep := goPackage.Steps.New;
oStep.Name := STR_FTP_STEP_NAME;
oStep.Description := STR_FTP_STEP_DESC;
oStep.ExecutionStatus := 1;
oStep.TaskName := STR_FTP_TASK_NAME;
oStep.CommitSuccess := False;
oStep.RollbackFailure := False;
oStep.ScriptLanguage := 'VBScript';
oStep.AddGlobalVariables := True;
oStep.RelativePriority := 3;
oStep.CloseConnection := False;
oStep.ExecuteInMainThread := False;
oStep.IsPackageDSORowset := False;
oStep.JoinTransactionIfPresent := False;
oStep.DisableStep := False;
oStep.FailPackageOnError := False;
goPackage.Steps.Add(oStep);
oStep := NULL;
oTask := goPackage.Tasks.New('DTSFTPTask');
oTask.Name := STR_FTP_TASK_NAME;
oCustomTask1 := oTask.CustomTask;
oCustomTask1.Name := STR_FTP_TASK_NAME;
oCustomTask1.Description := STR_FTP_TASK_DESC;
oCustomTask1.SourceLocation := 0;
oCustomTask1.SourceSite := Global.FTPRemoteHostIP;
oCustomTask1.SourceUsername := Global.FTPLogin;
oCustomTask1.SourcePassword := Global.FTPPassword;
oCustomTask1.DestSite := Global.FTPLocalDir;
oCustomTask1.NonOverwritable := 0
oCustomTask1.NumRetriesOnSource := Global.FTPRetryTimes;
goPackage.Tasks.Add(oTask);
//
goPackage.Execute; // Too many times used here.!!!
......
Can I execute the package in another way? For example, let it execute
background and I can check the status to see whether it has finished or not,
and I can also display the running status of the package.
Thanks very much for any suggestion!!!
Best Regards,
Grant