在Sql Server 2012开始,微软给SSIS添加了Project Model这种新的项目类型,与之对应的是在Sql Server数据库引擎中引入了Intergration Services Catalog这种新的部署方式。

当你在Sql Server中启用Intergration Service Catalog后,就会在Intergration Services Catalog下多出一个系统文件夹叫SSISDB,如下图所示我们已经发布了一个SSIS项目SSIS_LOG_TESTING到子文件夹Demo_Project_Folder下:

而在数据库中,我们也可以看到Sql Server自动生成了一个名叫SSISDB的数据库,该数据库就是用来存储Intergration Services Catalog下的项目数据的,请不要乱动其中的数据。

用过SSIS Project Model的开发人员应该都知道,这种新的项目类型相比老的Package Model有很多好处,其中一个好处就是可以在项目级别上定义全局参数,SSIS项目中的所有dtsx包都可以访问项目参数,如下图所示:

而当项目发布到Intergration Services Catalog后,也可以在Intergration Services Catalog上直接修改这些项目参数的值:

但是随之而来的问题是,随着在Intergration Services Catalog部署的SSIS项目越来越多,有没有什么办法能过统一管理这些SSIS项目的参数呢?因为Project Model的项目参数有个很大的缺点,那就是没有办法将其值存储在数据库中,而老的Pakacge Model是可以将SSIS项目中Configuration中的值存储在数据库表中的。所以导致了Project Model的项目参数没法集中管理,设想一下你的Intergration Services Catalog下如果有100个SSIS项目,假如这100项目都有一个同名的项目参数叫UserName,你现在想更改这100个项目的UserName项目参数,你只有手动打开每个项目的配置去设置UserName项目参数,是一件很耗时的操作。

而Intergration Services Catalog生成的数据库SSISDB中提供了一系列视图和存储过程,可以让我们用Sql语句来操作每个SSIS项目的项目参数,如下图所示:

其中有一个视图和存储过程特别有用,这里列出来:

视图catalog.object_parameters


该视图可以返回在Intergration Services Catalog中发布所有SSIS项目的项目参数信息,官方介绍如下:

Displays the parameters for all packages and projects in the  Integration Services catalog.

Column name Data type Description
parameter_id bigint The unique identifier (ID) of the parameter.
project_id bigint The unique ID of the project.
object_type smallint The type of parameter. The value is 20 for a project parameter and the value is 30 for a package parameter.
object_name sysname The name of the corresponding project or package.
parameter_name sysname(nvarchar(128)) The name of the parameter.
data_type nvarchar(128) The data type of the parameter.
required bit When the value is 1, the parameter value is required in order to start the execution. When the value is 0, the parameter value is not required to start the execution.
sensitive bit When the value is 1, the parameter value is sensitive. When the value is 0, the parameter value is not sensitive.
description nvarchar(1024) An optional description of the package.
design_default_value sql_variant The default value for the parameter that was assigned during the design of the project or package.
default_value sql_variant The default value that is currently used on the server.
value_type char(1) Indicates the type of parameter value. This field displays V when parameter_value is a literal value and R when the value is assigned by referencing an environment variable.
value_set bit When the value is 1, the parameter value has been assigned. When the value is 0, the parameter value has not been assigned.
referenced_variable_name nvarchar(128) The name of the environment variable that is assigned to the value of the parameter. The default value is NULL.
validation_status char(1) Identified for informational purposes only. Not used in  SQL Server 2017.
last_validation_time datetimeoffset(7) Identified for informational purposes only. Not used in  SQL Server 2017.

Permissions

To see rows in this view, you must have one of the following permissions:  +

  • READ permission on the project

  • Membership to the ssis_admin database role

  • Membership in the sysadmin server role.

    Row-level security is enforced; only rows that you have permission to view are displayed.

MSDN链接

该视图查询结果截图如下:

存储过程catalog.set_object_parameter_value


该存储过程可以设置在Intergration Services Catalog中部署SSIS项目的项目参数,官方介绍如下:

Sets the value of a parameter in the  Integration Services catalog. Associates the value to an environment variable or assigns a literal value that is used by default when no other values are assigned.

Syntax

catalog.set_object_parameter_value [@object_type =] object_type
, [@folder_name =] folder_name
, [@project_name =] project_name
, [@parameter_name =] parameter _name
, [@parameter_value =] parameter_value
[ , [@object_name =] object_name ]
[ , [@value_type =] value_type ]

Arguments

[@object_type =] object_type The type of parameter. Use the value 20 to indicate a project parameter or the value 30 to indicate a package parameter. The object_type is smallInt.

[@folder_name =] folder_name The name of the folder that contains the parameter. The folder_name is nvarchar(128).

[@project_name =] project_name The name of the project that contains the parameter. The project_name is nvarchar(128).

[@parameter_name =] parameter_name The name of the parameter. The parameter_name is nvarchar(128).

[@parameter_value =] parameter_value The value of the parameter. The parameter_value is sql_variant.

[@object_name =] object_name The name of the package. This argument required when the parameter is a package parameter. The object_name is nvarchar(260).

[@value_type =] value_type The type of parameter value. Use the character V to indicate that parameter_value is a literal value that is used by default when no other values are assigned prior to execution. Use the character R to indicate that parameter_value is a referenced value and has been set to the name of an environment variable. This argument is optional, the character V is used by default. The value_type is char(1).

Return Code Value

0 (success)

Result Sets

None

Permissions

This stored procedure requires one of the following permissions:

    • READ and MODIFY permissions on the project

    • Membership to the ssis_admin database role

    • Membership to the sysadmin server role

Errors and Warnings

The following list describes some conditions that may cause the stored procedure to raise an error:

    • The parameter type is not valid

    • The project name is not valid

    • For package parameters, the package name is not valid

    • The value type is not valid

    • The user does not have the appropriate permissions

Remarks

  • If no value_type is specified, a literal value for parameter_value is used by default. When a literal value is used, the value_set in the object_parameters view is set to 1. A NULL parameter value is not allowed.

  • If value_type contains the character R, which denotes a referenced value, parameter_value refers to the name of an environment variable.

  • The value 20 may be used for object_type to denote a project parameter. In this case, a value for object_name is not necessary, and any value specified for object_name is ignored. This value is used when the user wants to set a project parameter.

  • The value 30 may be used for object_type to denote a package parameter. In this case, a value for object_name is used to denote the corresponding package. If object_name is not specified, the stored procedure returns an error and terminates.

MSDN链接

该存储过程的执行结果如下:

EXEC catalog.set_object_parameter_value 20,N'Demo_Project_Folder',N'SSIS_LOG_TESTING',N'ProjectVersion',N'2.0.0.0'

在Sql Server Intergration Service中设置Catalog下所部署所有项目的参数值的更多相关文章

  1. SSRS (SQL Server Report Service) 在IE9, IE10下显示不全的解决办法

    原文:SSRS (SQL Server Report Service) 在IE9, IE10下显示不全的解决办法 在做项目的过程中遇到SSRS与IE9, IE10不兼容的情况,具体表现为报表页面在IE ...

  2. SQL Server Reporting Service(SSRS) 第六篇 SSRS 部署总结

    前段时间完成了第一批次SSRS报表的开发,本来以为大功已经告成,结果没有想到在整个发布与部署过程中还是遇到了很多的问题,现将这些问题一一列举出来,希望对以后能够有所启发! 1. 关于数据源与数据集的发 ...

  3. SQL Server R2 2008中的SQL Server Management Studio 阻止保存要求重新创建表的更改问题的设置方法

    在2008中会加入阻止保存要求重新创建表的更改这个选项.症状表现为修改表结构的时候会"阻止"你. SQL Server 2008“阻止保存要求重新创建表的更改”的错误的解决方案是本 ...

  4. SQL Server Reporting Service(SSRS) 第一篇 我的第一个SSRS例子

    很早就知道SQL SERVER自带的报表工具SSRS,但一直没有用过,最近终于需要在工作中一展身手了,于是我特地按照自己的理解做了以下总结: 1. 安装软件结构 SSRS全称SQL Server Re ...

  5. SQL Server 2005 Service Broker

    一.引言 SQL Server 2005 的一个主要成就是可以实现可靠.可扩展且功能完善的数据库应用程序.与 .NET Framework 2.0 公共语言运行库 (CLR) 的集成使开发人员可以将重 ...

  6. C#面试题(转载) SQL Server 数据库基础笔记分享(下) SQL Server 数据库基础笔记分享(上) Asp.Net MVC4中的全局过滤器 C#语法——泛型的多种应用

    C#面试题(转载) 原文地址:100道C#面试题(.net开发人员必备)  https://blog.csdn.net/u013519551/article/details/51220841 1. . ...

  7. Sql Server Report Service 的部署问题(Reporting Service 2014為什麼不需要IIS就可以運行)

    http://www.cnblogs.com/syfblog/p/4651621.html Sql Server Report Service 的部署问题 近期在研究SSRS部署问题,因为以前也用到过 ...

  8. Sql Server Report Service 的部署问题

    近期在研究SSRS部署问题,因为以前也用到过SSRS报表,但当时开发的报表是有专门的集成系统的,不需要我自己去部署,所以对这一块的部署也不熟悉,我记得当时我是直接开发出一个SSRS 报表,然后会通过自 ...

  9. [转]Sql Server Report Service 的部署问题

    本文转自:https://www.cnblogs.com/syfblog/p/4651621.html 近期在研究SSRS部署问题,因为以前也用到过SSRS报表,但当时开发的报表是有专门的集成系统的, ...

随机推荐

  1. LVM 详解

    一.前言<http://blog.chinaunix.net/uid-186064-id-2823296.html> LVM是逻辑卷管理(Logic Volume Manage)的简称,它 ...

  2. java方向及学习方法

    随笔:由于回首最近刚刚上班的缘故,平时基本没时间上播客了,所以回首会定期的抽时间分享一些干货给朋友们,就是周期不会像之前那么频繁了.最近有朋友跟回首说想没事儿的时候自学Java,但苦于不知道怎么去学, ...

  3. 小白的Python之路 day5 random模块和string模块详解

    random模块详解 一.概述 首先我们看到这个单词是随机的意思,他在python中的主要用于一些随机数,或者需要写一些随机数的代码,下面我们就来整理他的一些用法 二.常用方法 1. random.r ...

  4. C#winform程序关闭计算机的正确姿势

    /// <summary> /// 计算机电源控制类 /// </summary> public class EnvironmentCheckClass { [DllImpor ...

  5. [Spark内核] 第31课:Spark资源调度分配内幕天机彻底解密:Driver在Cluster模式下的启动、两种不同的资源调度方式源码彻底解析、资源调度内幕总结

    本課主題 Master 资源调度的源码鉴赏 [引言部份:你希望读者看完这篇博客后有那些启发.学到什么样的知识点] 更新中...... 资源调度管理 任务调度与资源是通过 DAGScheduler.Ta ...

  6. 日志采集框架Flume以及Flume的安装部署(一个分布式、可靠、和高可用的海量日志采集、聚合和传输的系统)

    Flume支持众多的source和sink类型,详细手册可参考官方文档,更多source和sink组件 http://flume.apache.org/FlumeUserGuide.html Flum ...

  7. K:二叉树

    相关介绍:  二叉树是一种特殊的树,它的每个节点最多只有两棵子树,并且这两棵子树也是二叉树.由于二叉树中的两棵子树有左右之分,为此,二叉树是有序树. 二叉树的定义:  二叉树是由n(n>=0)个 ...

  8. eslint 的基本配置介绍

    eslint 这个代码规则,是在用webpack +vue-cli这个脚手架时候接触的,默认的规则可能不太习惯我们日常平时的代码开发,需要对这个规则稍加改造. 下面的是 eslintrc.js的基本规 ...

  9. koa2教程(一)-快速开始

    来自Koa官网对于Koa的简介: koa 是由 Express 原班人马打造的,致力于成为一个更小.更富有表现力.更健壮的 Web 框架. 使用 koa 编写 web 应用,通过组合不同的 async ...

  10. ECharts模拟迁徙案例

    ECharts模拟迁徙案例 独立页面:http://211.140.7.173:8081/t/wuhairui/ditu/a.html