已答复 SSIS custom component

  • Tuesday, February 12, 2013 8:41 PM
     
      Has Code

    Hi All, 

    I am trying to build SSIS  custom component as mentioned in SSIS 2012 professional book wrox publication page 598 chapter 18 but I am unable to see the built component in data tools (SQL SERVER 2012 ) even after refreshing the componets list.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Microsoft.SqlServer.Dts.Pipeline;
    using Microsoft.SqlServer.Dts.Runtime;
    
    
    namespace Wrox.buffer
    {
        [DtsPipelineComponent(DisplayName = "SeeBuffer", ComponentType = ComponentType.Transform)]
            public class SeeBufferComponent : PipelineComponent
            {
                public override void ProcessInput(int inputID, PipelineBuffer buffer)
                {
                    int numberOfRows = buffer.RowCount;
                    bool eof = buffer.EndOfRowset;
                }
            }
        
    }
    

    Postbiult

    "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe" -u $(TargetName)
    "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\gacutil.exe" -i $(TargetFileName)
    copy $(TargetPath) "%PROGRAMFILES%\Microsoft SQL Server\110\DTS\PipelineComponents " /Y


    Sri.Tummala

All Replies

  • Wednesday, February 13, 2013 7:22 AM
     
     

    HI Kali,

    This Link might be usefull for you.

    http://msdn.microsoft.com/en-us/library/ms403356%28v=SQL.110%29.aspx

    Regards

    Naveen

  • Wednesday, February 13, 2013 8:07 AM
    Moderator
     
     Answered Has Code

    This is a code snippet from my checksum transformation (I use a separate project for the GUI: ChecksumUI):

    using System;
    using System.Security.Cryptography;
    using System.Text;
    using Microsoft.SqlServer.Dts.Pipeline;
    using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
    using Microsoft.SqlServer.Dts.Runtime.Wrapper;
    using System.Collections.Generic;
    
    namespace ilionx.SSIS.Components
    {
            [DtsPipelineComponent(
            DisplayName = "Checksum",
            ComponentType = ComponentType.Transform,
            Description = "Calculates a checksum-hash on selected columns",
            IconResource = "ilionx.SSIS.Components.Checksum.ico",
            UITypeName = "ilionx.SSIS.Components.ChecksumInterface, ilionx.SSIS.Components.ChecksumUI, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=4b526s7s5ses7ff7",
            CurrentVersion = 1
        )]
        public class Checksum : PipelineComponent
        {
    	
            /// <summary>
            /// Called when a PipelineBuffer is passed to the component.
            /// </summary>
            /// <param name="inputID">The ID of the Input that the buffer contains rows for.</param>
            /// <param name="buffer">The PipelineBuffer containing the columns defined in the IDTSInput100.</param>
            [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2201:DoNotRaiseReservedExceptionTypes"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.Exception.#ctor(System.String)")]
            public override void ProcessInput(int inputID, PipelineBuffer buffer)
            {
    		
    		}
    		
    }


    And this is the post build event I use for my 2012 tasks and transformations:

    cd $(ProjectDir)

    @SET TASKDIR="C:\Program Files (x86)\Microsoft SQL Server\110\DTS\PipelineComponents\"
    @SET GACUTIL="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil.exe"

     

    Echo Installing dll in GAC
    Echo $(OutDir)
    Echo $(TargetFileName)
    %GACUTIL% -if "$(OutDir)$(TargetFileName)"

    Echo Copying files to Tasks
    copy "$(OutDir)$(TargetFileName)" %TASKDIR%


    Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com | Twitter