SSIS中用于脚本组件C#文件的版本控制

3
我在使用SSIS进行版本控制时遇到了问题。当我编写脚本组件时,它被作为二进制文件而不是C#文件进行版本控制(虽然可以理解)。因此,下次我在脚本组件的C#文件中进行更改时,我无法看到代码的差异。
有没有办法解决这个问题?你们如何处理这个问题?
谢谢, Vaibhav
1个回答

2
我目前使用的所有SSIS包(SSIS 2008)都直接将脚本组件代码存储在.dtsx文件中(这些只是XML文件)。也就是说,您可以使用文本差异工具(Visual Studio Compare、WinMerge、BIDS Helper Smart Diff)来比较.dtsx文件。虽然这可能不是最干净的方法,但它确实允许您查看版本之间的区别。
以下是我从带有脚本组件的.dtsx文件中直接提取的片段(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;

是的,我认为这是目前唯一可用的选项。在标记此答案之前,我会等待更多的回答。谢谢! - Kumar Vaibhav

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接