Database Reference
In-Depth Information
sb.AppendLine("declare @ApplicationName varchar(255) = '"
+ applicationName + "'");
sb.AppendLine("declare @ApplicationID int");
sb.AppendLine();
sb.AppendLine("/* Add the SSIS First Application */");
sb.AppendLine("If Not Exists(Select ApplicationName");
sb.AppendLine("
From cfg.Applications");
sb.AppendLine("
Where ApplicationName
= @ApplicationName) ");
sb.AppendLine(" begin");
sb.AppendLine(" print 'Adding ' + @ApplicationName");
sb.AppendLine(" exec cfg.AddSSISApplication
@ApplicationName, @ApplicationID output");
sb.AppendLine(" print @ApplicationName + ' added.'");
sb.AppendLine(" end");
sb.AppendLine("Else");
sb.AppendLine(" begin");
sb.AppendLine(" Select @ApplicationID = ApplicationID");
sb.AppendLine(" From cfg.Applications");
sb.AppendLine(" Where ApplicationName
= @ApplicationName");
sb.AppendLine(" print @ApplicationName + ' already
exists in the Framework.'");
sb.AppendLine(" end");
sb.AppendLine("print ''");
sb.AppendLine();
The Transact-SQL for building parameters to manage package metadata is found in
the first sections of Listings A-5 and A-9 and is shown here in Listing 20-5 :
Listing 20-5 . SSIS Framework Package Parameters
declare @ExecutionOrder int = 10
declare @ApplicationID int = 1
declare @PackageID int = 1
declare @ApplicationName varchar(255) = 'SSISApp1'
declare @PackageFolder varchar(255)
 
 
Search WWH ::




Custom Search