I have a set of two jobs that 1) Parent job -- copy tables to the output database and 2) Child job -- inject PK constraint to the output database.
With the following job design, I am able to copy tables and inject PK constraint into the output database.
However, the last table didn't have PK constraint inserted --- the child job didn't insert PK into the last table.
**For more detail please check the attached zip.
PS. Both job work perfectly when executing separately.
Run Log
Table Name = tbl_site_mem dbo.tbl_site_mem|ALTER TABLE dbo.tbl_site_mem ADD CONSTRAINT PK_tbl_site_mem PRIMARY KEY (site_id, mem_id);
Table Name = dbo.tbl_site_mem
AND the Query is = ALTER TABLE dbo.tbl_site_mem ADD CONSTRAINT PK_tbl_site_mem PRIMARY KEY (site_id, mem_id);
The log also shows that tables are created and its PK are loaded, but PK constraint are not inserted into the table.
Parent job -- copy tables to the output database
Though I set up two DBConnection components, I didn't actually use it for DBOutput...
I don't really understand why but when I use an existing connection 'tDBConnection_2', the last table data is not inserted into the database...
So I setup DB Connection manually here.
Child job --- inject PK constraint to the output database
In the child job's DBRow component, I tried both 'use existing connection' and manual setting, but still only the last table didn't have its PK inserted.
tDBCommit uses existing connection (as there's no option for manual setup)