﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by U.K Padmaja / Article Discussions / Article Discussions by Author  / SSIS Programming / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 19 Jun 2013 04:45:26 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: SSIS Programming</title><link>http://www.sqlservercentral.com/Forums/Topic366187-387-1.aspx</link><description>Learn more about programming SSIS packages in C# .net and VB .net from the below link:http://www.sqllion.com/2009/05/ssis-programming-basic/Thanks,</description><pubDate>Tue, 27 Apr 2010 09:58:27 GMT</pubDate><dc:creator>mail.arun2005</dc:creator></item><item><title>RE: SSIS Programming</title><link>http://www.sqlservercentral.com/Forums/Topic366187-387-1.aspx</link><description>I'm confused.The article seems to be about using the SSIS instalation that comes with SQL Server 2005. However, the links out to the Microsoft web site reslove to pages that deal with SQL Server 2008, which is quite a different product.</description><pubDate>Thu, 08 Apr 2010 13:52:01 GMT</pubDate><dc:creator>James Collett</dc:creator></item><item><title>RE: SSIS Programming</title><link>http://www.sqlservercentral.com/Forums/Topic366187-387-1.aspx</link><description>Hi,   It is very useful article at certain extent. I have a situation. I have to create an excel file and have to load data in different excel sheets of same excel file, and also i have to create excel file at runtime. Can anybody help me out in this regardThanksUmair Zubairy</description><pubDate>Tue, 27 Oct 2009 18:37:20 GMT</pubDate><dc:creator>umair.zubairy</dc:creator></item><item><title>RE: SSIS Programming</title><link>http://www.sqlservercentral.com/Forums/Topic366187-387-1.aspx</link><description>I'm using a VERY simple script that works to change my flat file connection path but can't get the syntax to set the DataRowsToSkip property of the connection. To change the path I'm using:Dts.Connections("ReturnDataFile").ConnectionString = Dts.Variables("FullPath").Value.ToStringHow would I change the datarowstoskip for an integer variable HEADR:Dts.Connections("ReturnDataFile").Properties("DataRowsToSkip") = Dts.Variables("HEADR").Value?????????????Thanks,Joe B</description><pubDate>Tue, 26 Aug 2008 13:31:57 GMT</pubDate><dc:creator>JBANKO</dc:creator></item><item><title>RE: SSIS Programming</title><link>http://www.sqlservercentral.com/Forums/Topic366187-387-1.aspx</link><description>Hi Padmaja, Thank you for posting the code.  But, I still have a problem while loading the header array. Below is my codePublic Class ScriptMain    Sub Main()        ' Create a package and add a Data Flow task.        Dim package As Microsoft.SqlServer.Dts.Runtime.Package = New Microsoft.SqlServer.Dts.Runtime.Package()        package.PackageType = DTSPackageType.DTSDesigner90        package.Name = "MySSISPackage"        'Add Data Flow task        Dim taskDF As TaskHost = TryCast(package.Executables.Add("DTS.Pipeline.1"), TaskHost)        taskDF.Name = "DataFlow"        Dim DTP As MainPipe        DTP = TryCast(taskDF.InnerObject, MainPipe)        ' Creating OLEDB Connection Manager        Dim oleDbConn As ConnectionManager = package.Connections.Add("OLEDB")        oleDbConn.Name = "MyOLEDBConnection"        oleDbConn.ConnectionString = "Provider=SQLOLEDB.1;" &amp; _        "Data Source=" &amp; Dts.Variables("DestServer").Value.ToString &amp; ";Initial Catalog=" &amp; Dts.Variables("DestDB").Value.ToString &amp; ";Integrated Security=SSPI;"        MsgBox(Dts.Variables("DestServer").Value.ToString)        MsgBox(Dts.Variables("DestDB").Value.ToString)               'Creating FlatFile Connection Manager        Dim cnFile As ConnectionManager = package.Connections.Add("FLATFILE")        cnFile.Properties("Name").SetValue(cnFile, "MyFlatFileConnection")       cnFile.Properties("ConnectionString").SetValue(cnFile, Dts.Variables("SourceFile").Value.ToString)        cnFile.Properties("Format").SetValue(cnFile, "Delimited")        cnFile.Properties("Unicode").SetValue(cnFile, False)        cnFile.Properties("ColumnNamesInFirstDataRow").SetValue(cnFile, True)        cnFile.Properties("DataRowsToSkip").SetValue(cnFile, 0)        cnFile.Properties("RowDelimiter").SetValue(cnFile, vbCrLf)        cnFile.Properties("TextQualifier").SetValue(cnFile, """")        cnFile.Properties("HeaderRowsToSkip").SetValue(cnFile, 0)        cnFile.Properties("HeaderRowDelimiter").SetValue(cnFile, vbCrLf)        cnFile.Properties("CodePage").SetValue(cnFile, 1252)        Dim MyFlatFilecn As SSISRuntime.IDTSConnectionManagerFlatFile90 = Nothing        MyFlatFilecn = TryCast(cnFile.InnerObject, SSISRuntime.IDTSConnectionManagerFlatFile90)        DtsConvert.ToConnectionManager90(cnFile)        Dim name As SSISRuntime.IDTSName90        Dim col As SSISRuntime.IDTSConnectionManagerFlatFileColumn90        cnFile.AcquireConnection(Nothing)        ' Add columns to the FlatFileConnectionManager        Dim headers As String()        headers = Split((Dts.Variables("col1").Value.ToString), ",")        'Dim headers As String() = {"col1", "col2", "col3", "col4"}        'Get the header row from flat file. This can be stored in a database table as well.        'Assuming that "headers" Array contains the headers        Dim i As Integer = 0        While i &amp;lt; headers.Length            col = MyFlatFilecn.Columns.Add()            If i = headers.Length - 1 Then                col.ColumnDelimiter = vbCrLf            Else                col.ColumnDelimiter = ","            End If            col.ColumnType = "Delimited"            col.DataType = Microsoft.SqlServer.Dts.Runtime.Wrapper.DataType.DT_WSTR            name = TryCast(col, SSISRuntime.IDTSName90)            name.Name = headers(i)            'get the converSion information from the destination table            'this should assign the appropriate datatype, precision, scale and length to col            'getConversionInfo(col, name.Name) 'implement this            i = i + 1        End While        cnFile.ReleaseConnection(Nothing)        'Creating Data Flow which does the actual job of copying the data from flat file to table        'For that, creating flat file Source        Dim DFSource As IDTSComponentMetaData90        DFSource = DTP.ComponentMetaDataCollection.New()        DFSource.ComponentClassID = "DTSAdapter.FlatFileSource"        DFSource.Name = "FlatFileSource"        Dim Sourceinst As CManagedComponentWrapper        ' Get the design time instance of the component.        Sourceinst = DFSource.Instantiate()        ' Initialize the component.        Sourceinst.ProvideComponentProperties()        ' Specify the connection manager.        'If DFSource.RuntimeConnectionCollection.Count &amp;gt; 0 Then        DFSource.RuntimeConnectionCollection(0).ConnectionManagerID = package.Connections("MyFlatFileConnection").ID()        DFSource.RuntimeConnectionCollection(0).ConnectionManager = DtsConvert.ToConnectionManager90(package.Connections("MyFlatFileConnection"))        'End If        ' Reinitialize the metadata.        Sourceinst.AcquireConnections(Nothing)        Sourceinst.ReinitializeMetaData()        Dim exOutColumn As IDTSExternalMetadataColumn90        For Each outColumn As IDTSOutputColumn90 In DFSource.OutputCollection(0).OutputColumnCollection            exOutColumn = DFSource.OutputCollection(0).ExternalMetadataColumnCollection(outColumn.Name)            Sourceinst.MapOutputColumn(DFSource.OutputCollection(0).ID, outColumn.ID, exOutColumn.ID, True)        Next        Sourceinst.ReleaseConnections()        'Add the OLEDB Destination        Dim DFdestination As IDTSComponentMetaData90        DFdestination = DTP.ComponentMetaDataCollection.[New]()        DFdestination.ComponentClassID = "DTSAdapter.OLEDBDestination"        DFdestination.Name = "OLEDBDestination"        Dim DestInst As CManagedComponentWrapper = DFdestination.Instantiate()        DestInst.ProvideComponentProperties()        If DFdestination.RuntimeConnectionCollection.Count &amp;gt; 0 Then            DFdestination.RuntimeConnectionCollection(0).ConnectionManagerID = package.Connections("MyOLEDBConnection").ID()            DFdestination.RuntimeConnectionCollection(0).ConnectionManager = DtsConvert.ToConnectionManager90(package.Connections("MyOLEDBConnection"))        End If                'Set the customproperties of the source        DestInst.SetComponentProperty("OpenRowset", Dts.Variables("DestTable").Value.ToString)        DestInst.SetComponentProperty("AccessMode", 0)        'reinitialize the Component        DestInst.AcquireConnections(Nothing)        DestInst.ReinitializeMetaData()        DestInst.ReleaseConnections()        'Map a Connection betwen the source and destination        Dim path As IDTSPath90 = DTP.PathCollection.[New]()        path.AttachPathAndPropagateNotifications(DFSource.OutputCollection(0), DFdestination.InputCollection(0))        Dim input As IDTSInput90 = DFdestination.InputCollection(0)        Dim destinationInputID As Integer = CInt(input.ID)        Dim vInput As IDTSVirtualInput90 = input.GetVirtualInput()        For Each vColumn As IDTSVirtualInputColumn90 In vInput.VirtualInputColumnCollection            ' This will create an input column on the component.            DestInst.SetUsageType(destinationInputID, vInput, vColumn.LineageID, DTSUsageType.UT_READONLY)            ' Get input column.            Dim inputColumn As IDTSInputColumn90 = input.InputColumnCollection.GetInputColumnByLineageID(vColumn.LineageID)            ' Getting the corresponding external column.            ' Ex : We will use the column name as the basis for matching data flow columns to external columns.            Dim externalColumn As IDTSExternalMetadataColumn90 = input.ExternalMetadataColumnCollection(vColumn.Name)            ' Tell the component how to map.            DestInst.MapInputColumn(destinationInputID, inputColumn.ID, externalColumn.ID)        Next        'Validate the package        MsgBox("Validating the package")        Dim pkgStatus As DTSExecResult = package.Validate(Nothing, Nothing, Nothing, Nothing)        'System.Console.WriteLine("Validationresult: " &amp; pkgStatus.ToString())        'Save the package        Dim SSISExe As New Application()        SSISExe.SaveToXml("C:\temp\MySSISPackage.dtsx", package, Nothing)        'Execute the package        If pkgStatus = DTSExecResult.Success Then            MsgBox("Executing the Package")            Dim pkgResult As DTSExecResult = package.Execute()            MsgBox("Package validation success")        Else            MsgBox("Package Validation failed")        End If    End SubEnd Class              As you can see in the above code, I have tried to pass the column names into the header array in 2 ways. When I give the column names directly into the array   like:(Dim headers As String() = {"col1", "col2", "col3", "col4"}) script is going good and the data is loaded into the destination table.  But  When I am trying to pass the column names  using a variable like:(  Dim headers As String()   headers = Split((Dts.Variables("col1").Value.ToString), ","), it throws the following errorError: The script threw an exception: Exception from HRESULT: 0xC0010009,DTS_E_ELEMENTNOTFOUNDPlease let me know, where am I going wrong</description><pubDate>Thu, 03 Jul 2008 12:48:13 GMT</pubDate><dc:creator>tk-639222</dc:creator></item><item><title>RE: SSIS Programming</title><link>http://www.sqlservercentral.com/Forums/Topic366187-387-1.aspx</link><description>Thanks Padmaja!</description><pubDate>Tue, 12 Jun 2007 08:00:00 GMT</pubDate><dc:creator>Ram-425798</dc:creator></item><item><title>RE: SSIS Programming</title><link>http://www.sqlservercentral.com/Forums/Topic366187-387-1.aspx</link><description>&lt;P&gt;After reviewing the article, I think it is probably an excellent article . . . if I wanted to create the SSIS package in a .NET language.  However, since I find writing a program in order to program an SSIS package to be, IMHO, taking the longest possible route to get from point A to point B, I believe that the title of the article is misleading.  THe title should be something more like "Programming an SSIS Package in .NET".&lt;/P&gt;&lt;P&gt;What I expected, from the title, was an article on developing an SSIS package from within BIDS.  Needless to say, I was disappointed; howver, I will add this to my Briefcase on the off chance that I may need to perform a similar task.&lt;/P&gt;</description><pubDate>Tue, 12 Jun 2007 07:47:00 GMT</pubDate><dc:creator>Ralph D. Wilson II</dc:creator></item><item><title>RE: SSIS Programming</title><link>http://www.sqlservercentral.com/Forums/Topic366187-387-1.aspx</link><description>&lt;P&gt;Ram:&lt;/P&gt;&lt;P&gt;I have given the assemblies to be referred in the article itself (see 3.Getting started)&lt;/P&gt;&lt;P&gt;AndreQ1:&lt;/P&gt;&lt;P&gt;You could combine the common (or default) settings into functions and can then be called appropriately.&lt;/P&gt;&lt;P&gt;For simple file transfers, DTS and SSIS may not differ much. When it comes to Transformations, SSIS provides many new features when compared to DTS. You can have a look at MSDN for the different Transformations supported in SSIS. Hope that helps.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description><pubDate>Tue, 12 Jun 2007 04:41:00 GMT</pubDate><dc:creator>U.K Padmaja</dc:creator></item><item><title>RE: SSIS Programming</title><link>http://www.sqlservercentral.com/Forums/Topic366187-387-1.aspx</link><description>&lt;P&gt;Given the great detail that's possible, and may be required, would it be possible to create additional libraries of functions that have many defaults set up. For example, the code below (taken from your article) would appear to be used for most text data files:&lt;/P&gt;&lt;P&gt;cnFile.Properties("ColumnNamesInFirstDataRow").SetValue(cnFile, True)cnFile.Properties("DataRowsToSkip").SetValue(cnFile,0)cnFile.Properties("RowDelimiter").SetValue(cnFile,vbCrLf)cnFile.Properties("TextQualifier").SetValue(cnFile,"""")cnFile.Properties("HeaderRowsToSkip").SetValue(cnFile, 0)cnFile.Properties("HeaderRowDelimiter").SetValue(cnFile,vbCrLf)cnFile.Properties("CodePage").SetValue(cnFile,1252)&lt;/P&gt;&lt;P&gt;It is not yet apparent to me the benefit of this technique over DTS for the majority of file transformations.&lt;/P&gt;&lt;P&gt;Let me know if my reasoning on this issue makes sense.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;AndreQ1&lt;/P&gt;</description><pubDate>Mon, 11 Jun 2007 14:05:00 GMT</pubDate><dc:creator>AndreQ1-315878</dc:creator></item><item><title>RE: SSIS Programming</title><link>http://www.sqlservercentral.com/Forums/Topic366187-387-1.aspx</link><description>&lt;P&gt;Ms. Padmaja!&lt;/P&gt;&lt;P&gt;First of all, an exemplary topic.&lt;/P&gt;&lt;P&gt;As you mentioned, I would like to use  other approach that is to use the API to create, configure and run packages from own applications.&lt;/P&gt;&lt;P&gt;I am using C#. What DLLs I must add it to this?&lt;/P&gt;&lt;P&gt;Thanks and looking forward to hear from you.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;</description><pubDate>Mon, 11 Jun 2007 09:42:00 GMT</pubDate><dc:creator>Ram-425798</dc:creator></item><item><title>SSIS Programming</title><link>http://www.sqlservercentral.com/Forums/Topic366187-387-1.aspx</link><description>Comments posted here are about the content posted at &lt;A HREF="http://www.sqlservercentral.com/columnists/Upadmaja/3003.asp"&gt;http://www.sqlservercentral.com/columnists/Upadmaja/3003.asp&lt;/A&gt;</description><pubDate>Tue, 15 May 2007 22:41:00 GMT</pubDate><dc:creator>U.K Padmaja</dc:creator></item></channel></rss>