SSIS 保留未使用和不相关的 OLE DB 信息

SSIS keeps unused and unrelated OLE DB information

为什么 SSIS 保留未使用和不相关的 OLE DB 项目?

在此包中,AccessMode 4 表示它使用 OpenRowsetVariable。但是,OpenRowset 和 SqlCommand 可能具有引用包中未使用的 table 的值。为了简洁起见,我省略了一些行。即使 User::StgTable 可能指定 CUSTOMER。 OpenRowset 可能引用 INVENTORY,SqlCommand 可能引用 DIVISION table.

提出这个问题的情况是,当搜索 .dtsx 包时 'INVENTORY',找到了这个包,但它-不是-实际上指的是 INVENTORY。

删除 .dtsx 文件中这些未使用项目的文本安全吗?

<component
    description="OLE DB Destination"
    <properties>
        <property
            dataType="System.Int32"
            description="The number of seconds before a command times out.  A value of 0 indicates an infinite time-out."
            name="CommandTimeout">0</property>
        <property
            dataType="System.String"
            description="Specifies the name of the database object used to open a rowset."
            name="OpenRowset"></property>
        <property
            dataType="System.String"
            description="Specifies the variable that contains the name of the database object used to open a rowset."
            name="**OpenRowsetVariable**">**User::TableNameStg**</property>
        <property
            dataType="System.String"
            description="The SQL command to be executed."
            name="SqlCommand"
            UITypeEditor="Microsoft.DataTransformationServices.Controls.ModalMultilineStringEditor, Microsoft.DataTransformationServices.Controls, Version=15.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"></property>
        <property
            dataType="System.Int32"
            description="Specifies the mode used to access the database."
            name="AccessMode"
            typeConverter="**AccessMode**">**4**</property>

答案很简单 - dtsx 文件旨在与 SSIS 引擎一起使用并使用 Visual Studio 进行编辑,而不是直接编辑。
在执行开始时,SSIS 引擎将 dtsx 文件加载到引擎中的配置中,并根据提供的数据连接对其进行验证。一些参数可能未被使用,没有它不会影响加载和验证过程;但是,Microsoft 没有对此进行记录和支持。你得自己测试一下。
根据我的经验,可以在不影响包功能的情况下删除 dtsx XML 的一些标签和部分内容。这适用于所有任务和图表布局的 DTSID 属性。但是,在下一个文件打开时 Visual Studio 会重新添加这些属性。