SSISDB3:Environment

Environment 是ETL执行时使用的Parameters的集合,可以为一个Project引用不同的Environment variables,从而改变ETL执行的属性。

查看Environments,如图

1,Create Environment

EXEC [SSISDB].[catalog].[create_environment]
    @environment_name=N‘WeekDay‘,
    @environment_description=N‘‘,
    @folder_name=N‘Demo‘

GO

2,在环境中创建变量

DECLARE @var sql_variant = N‘"first"‘
EXEC [SSISDB].[catalog].[create_environment_variable]
    @variable_name=N‘VarEnv‘,
    @sensitive=False,
    @description=N‘‘,
    @environment_name=N‘WeekDay‘,
    @folder_name=N‘Demo‘,
    @value=@var,
    @data_type=N‘String‘
GO

3,将项目配置为引用Environment

右击ProjectName,点击Configure,在Parameters Tab中查看project的Parameters。

点击References Tab,设置project 引用Environment。

Declare @reference_id bigint
EXEC [SSISDB].[catalog].[create_environment_reference]
    @environment_name=N‘WeekDay‘,
    @environment_folder_name=N‘Demo‘,
    @reference_id=@reference_id OUTPUT,
    @project_name=N‘ISStudy‘,
    @folder_name=N‘Demo‘,
    @reference_type=A
Select @reference_id

GO

回到Parameters Tab,点击value column后面的ellipsis 设置project Variables引用 Environment variables。

EXEC [SSISDB].[catalog].[set_object_parameter_value]
    @object_type=20,
    @parameter_name=N‘VarEnv‘,
    @object_name=N‘ISStudy‘,
    @folder_name=N‘Demo‘,
    @project_name=N‘ISStudy‘,
    @value_type=R,
    @parameter_value=N‘VarEnv‘
GO

参数 @value_type ,参数值=R,表明参数值是一个引用值,且正在使用一个Environment Variable;参数值=V,表示参数是一个文本值

通过 catalog.environment_references 查看Reference

reference_type: Indicates whether the environment can be located in the same folder as the project (relative reference) or in a different folder (absolute reference). When the value is R, the environment is located by using a relative reference. When the value is A, the environment is located by using an absolute reference.

A project can have relative or absolute environment references. Relative references refer to the environment by name and require that it resides in the same folder as the project. Absolute references refer to the environment by name and folder, and may refer to environments that reside in a different folder than the project. A project can reference multiple environments.

对于Demo这个folder来说,LocalFolder下的Environment 是Relative Environment,在Demo下的Environment 是absolute Environment。

参考MSDN:catalog.environment_references (SSISDB Database)

4,执行Package,引用Environment Variable,在 [catalog].[create_execution] 的参数 @reference_id中设置引用对象

Declare @execution_id bigint
EXEC [SSISDB].[catalog].[create_execution]
    @package_name=N‘Package.dtsx‘,
    @execution_id=@execution_id OUTPUT,
    @folder_name=N‘Demo‘,
    @project_name=N‘ISStudy‘,
    @use32bitruntime=False,
    @reference_id=1

Select @execution_id

DECLARE @var0 smallint = 1
EXEC [SSISDB].[catalog].[set_execution_parameter_value]
        @execution_id,
        @object_type=50,
        @parameter_name=N‘LOGGING_LEVEL‘,
        @parameter_value=@var0

EXEC [SSISDB].[catalog].[start_execution] @execution_id
GO
时间: 2024-08-01 07:40:55

SSISDB3:Environment的相关文章

Oracle:environment variable "PATH" does not exceed the recommended length

今天重新安装oracle11g,突然在检测时报了以下错误: Environment variable: "PATH" - This test checks whether the length of the environment variable "PATH" does not exceed the recommended length. 预期值 : 1023 实际值 : 1332 错误列表: - PRVF-3929 : Adding the Oracle bin

UFT自学:Environment对象的使用;Msgbox和Print的区别

(1)读取Built-in 'file -> settings -> Enrionment -> variable type 为 Built-in os = Environment.Value("OS") os_version = Environment.Value("OSVersion") Msgbox os & os_version (2)设置和读取User-fined 'file -> settings -> Enrion

深入Spring Boot:那些注入不了的Spring占位符(${}表达式)

Spring里的占位符 spring里的占位符通常表现的形式是: <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource"> <property name="url" value="${jdbc.url}"/> </bean> 或者 @Confi

浅尝Windows Server 2016&mdash;&mdash;Container 容器:部署

容器上手其实挺快的,特别是在熟悉的Windows环境下.起步无非这么几件事: 1.安装Container Feature,容器功能角色 可以使用UI,当然也可以用PowerShell: Install-WindowsFeature containers Restart-Computer -Force 由于容器本身可以跑在物理机或者虚拟机中,可以顺便把Hyper-V也装了. 2.安装Docker 可以很炫的用PowerShell来拉取Docker引擎: Invoke-WebRequest "htt

Android—SDCard数据存取&amp;Environment简介

1:Environment简介: Environment是android.os包下的一个类,谷歌官方文旦的解释为:Provides access to environment variables(提供访问环境的变量),由此可看出,该类是用于程序访问SDCard的一个设备访问类 Environment 常量 构造方法 方法如下: 解析:比如字段:DIRECTORY_PICTURES 是返回SDcard中Pictures目录的名字 其中的SDCardPicturesName==“Pictures”:

Android开发系列(七):把文件存放在SDCard中

一般我们的手机应用默认的存储空间是手机自带的内存中,但是对于比较大的文件比如视频.音频来说,我们可以把它存放在SDCard中: 接下来通过代码实现具体的把文件存放在SDCard中(仅实现了核心代码) 首先,因为要存放在SDCard中,我们需要提供SDCard权限: 在AndroidManifest.xml中添加权限: <!-- 在SDCard创建与删除文件权限 --> <uses-permission android:name="android.permission.MOUNT

Android开发6:Service的使用(简单音乐播放器的实现)

前言 啦啦啦~各位好久不见啦~博主最近比较忙,而且最近一次实验也是刚刚结束~ 好了不废话了,直接进入我们这次的内容~ 在这篇博文里我们将学习Service(服务)的相关知识,学会使用 Service 进行后台工作, 学会使用 Service 与 Activity 进行通信,并在此知识基础上学会使用 MediaPlayer和简单的多线程编程.使用 Handle 更新 UI,并设计成功一个简单的音乐播放器. 是不是很高大上呢~一起来学习~ 基础知识 Service作为Android四大组件之一,在每

VS 2015相当不错的功能:C#交互窗口

按照惯例,老周是先吹牛后讲正事.今天就给大伙吹吹这个事. 有网友不知道是不是昨晚喝高了,居然研究起老周来了.实话告诉你,老周没什么好研究的,老周又不是编译器,老周只是一个游离于大善大恶之间的平凡人,说来也只不过是: 无故寻愁觅恨,有时似傻如狂.纵然生得好皮囊,腹内原来草莽.潦倒不通世务,愚顽怕读文章.行为偏僻性乖张,那管世人诽谤! 老周上不行圣人之道,下不通小人之事,渺渺乎,悠悠于人世间的一颗微尘罢了.所以,不要研究老周了. 网友感兴趣,老周你是怎么学到编程了的,而且还完全自学的. 唉,要说起这

Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name

今天在安装的测试环境下想启动一下OEM,结果启动的时候报了一个错如下: Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name. 按照错误提示是需要设置一下ORACLE_UNQNAME的,所以su - oracle 编辑配置文件如下: soure .bash_profile 使文件生效,在重新启动OEM,结果又报了另外一个错误, OC4J Configur