Database Reference
In-Depth Information
Dts.TaskResult = ScriptResults.Success
End Sub
Close the script editor and the Script Task Editor. Connect a precedence constraint
from the Log Start of Package Execute SQL task to the Log Start of Package Execute
SQL task.
If you execute Parent.dtsx now, you may get a foreign key constraint error
when you try to log the application variables. Why? PkgInstanceID is set to a de-
fault value, 0 , and there is no 0 row in the log.SSISPkgInstance table. Let's
remedy that now with the following script shown in Listing A-20 .
Listing A-20 . Adding0 ID Rows to Selected Tables in the SSISConfig Database
/* Add "0" rows */
If Not Exists(Select ApplicationID
From cfg.Applications
Where ApplicationID = 0)
begin
print 'Adding 0 row for cfg.Applications'
Set Identity_Insert cfg.Applications ON
Insert Into cfg.Applications
(ApplicationID
,ApplicationName)
Values
(0
,'SSIS Framework')
Set Identity_Insert cfg.Applications OFF
print '0 row for cfg.Applications added'
end
Else
print '0 row already exists for cfg.Applications'
print ''
If Not Exists(Select PackageID
From cfg.Packages
Where PackageID = 0)
begin
print 'Adding 0 row for cfg.Packages'
 
 
Search WWH ::




Custom Search