【问题标题】:Version control for Script Component C# files in SSISSSIS 中脚本组件 C# 文件的版本控制
【发布时间】:2013-12-13 07:56:43
【问题描述】:

我在使用带有 SSIS 的版本控制时遇到了这个问题。当我编写脚本组件时,它会以二进制文件而不是 C# 文件的形式检查到版本控制中(虽然这是可以理解的)。所以下次我对脚本组件的 C# 文件进行更改时,我无法看到代码的差异。

有没有办法解决这个问题? 你们怎么办?

谢谢, 毗婆娑

【问题讨论】:

    标签: version-control ssis script-component


    【解决方案1】:

    我目前使用的所有 SSIS 包 (SSIS 2008) 都将脚本组件代码直接存储在 .dtsx 文件中(这些只是 XML 文件)。也就是说,您可以使用文本差异工具(Visual Studio Compare、WinMerge、BIDS Helper Smart Diff)来比较 .dtsx 文件。虽然这可能不是最干净的方法,但它确实可以让您看到版本之间的差异。

    下面是我直接从带有脚本组件的 .dtsx 文件中提取的 sn-p(C# 存储为 CDATA):

    <component id="4829" name="ExecuteQuery" componentClassID="{2E42D45B-F83C-400F-8D77-61DDE6A7DF29}" description="Executes a custom script." localeId="-1" usesDispositions="false" validateExternalMetadata="True" version="4" pipelineVersion="0" contactInfo="Executes a custom script.;Microsoft Corporation; Microsoft SqlServer v10; © 2007 Microsoft Corporation; All Rights Reserved; http://www.microsoft.com/sql/support;4">
    <properties>
    <property id="4833" name="SourceCode" dataType="System.String" state="cdata" isArray="true" description="Stores the source code of the component" typeConverter="" UITypeEditor="" containsID="false" expressionType="None"><arrayElements arrayElementCount="18"><arrayElement dataType="System.String"><![CDATA[\main.cs]]></arrayElement><arrayElement dataType="System.String"><![CDATA[/* Microsoft SQL Server Integration Services Script Component
    *  Write scripts using Microsoft Visual C# 2008.
    *  ScriptMain is the entry point class of the script.*/
    
    using System;
    using System.Data;
    using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
    using Microsoft.SqlServer.Dts.Runtime.Wrapper;
    using Teradata.Client.Provider;
    [Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
    public class ScriptMain : UserComponent
    {
        private TdConnection tdCn;
        private TdCommand tdCmd;
        private TdDataReader tdRdr;
    

    【讨论】:

    • 是的,我认为这是目前唯一可用的选项。在标记这个之前,我将等待更多的答案。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多