Recently I have been working with a couple of SSIS projects on SQL Server 2012. During this time, I have managed to encounter an issue with SSISDB. This issue is quite trivial; however it can be important for querying/reporting deployed SSIS packages. In fact, I found this issue because I wanted to create a deployment script to configure Environment and SQL Job to run the SSIS project referencing the configured environment.
The issue is to do with SSISDB.catalog.get_parameter_values.
As documented on Books Online (http://msdn.microsoft.com/en-us/library/ff878039), to obtain all project parameters and the parameters from all packages, when executing catalog.get_parameter_values, the “package_name” input parameter should be set to NULL.
** Excerpt from BOL – catalog.get_parameter_values **
However when running the catalog.get_parameter_values stored procedure with @package_name set to NULL, it returns an error instead stating “The input parameter cannot be null”.
Msg 27138, Level 16, State 1, Procedure get_parameter_values, Line 18 The input parameter cannot be null. Provide a valid value for the parameter.
I have logged this as a bug at Microsoft Connect:
My own version: catalog.get_any_parameter_values
As a temporary workaround, I have a modified version of catalog.get_parameter_values where it is possible to retrieve all project parameters and package parameters in a single stored procedure call. I’m calling the new modified version, catalog.get_any_parameter_values which can be deployed to SSISDB and consumed in custom queries. Any built-in reports in SQL Server 2012 that may be calling catalog.get_parameter_values stored procedure will not be affected.
Please note that catalog.get_any_parameter_values is a draft version. Deploy and make use of it with care. This is intended to be as a supplement for administering Integration Services Catalog.
Example of usage:
USE [SSISDB] GO EXEC [catalog].[get_any_parameter_values] @folder_name = 'AdventureWorks BI', @project_name = 'AdventureWorks BI ETL', @package_name = NULL, @reference_id = NULL
The results will be similar to the following:
To deploy the script:
- Download catalog.get_any_parameter_values from here.
- Run the script against SSISDB database in a SQL Server 2012 Database Instance. The catalog.get_any_parameter_values stored procedure will be created and will only work within the target Integration Services Catalog. If there are multiple servers running Integration Services Catalog, the script needs to be deployed against SSISDB database of each server.
Compatibility level: SQL Server 2012 RTM (11.0.2100)
If you have any feedback on my catalog.get_any_parameter_values stored procedure, please let me know. More importantly, please vote for the bug ticket relating to catalog.get_parameter_values at Microsoft Connect. https://connect.microsoft.com/SQLServer/feedback/details/743735/ssisdb-catalog-get-parameter-values-with-null-able-package-name-input-parameter#details
An alternative workaround to the issue in catalog.get_parameter_values is to call the catalog.get_parameter_values once per project and per package in the project. I think this is a little inefficient but will do the job well with little risk on the SSISDB.