SSIS Script Component Error

Apr 11, 2008

Hi,

In one of the SSIS package, I have a Script Component with ReadWrite variables --> TotalRecordCount, JobName, CycleCode

But suddenly in our Prod server from where the SSIS package is executed against our Prod DB server (SQL Server 2005 SP2), it failed. The error message was

Error: 2008-04-11 07:31:20.61
Code: 0xC0047062
Source: DFT PolicyTerm Load SCR Balancing [839]
Description: System.Runtime.InteropServices.COMException (0xC001404D): Exception from HRESULT: 0xC001404D
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PostExecute()
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPostExecute(IDTSManagedComponentWrapper90 wrapper)
End Error

I am attaching the code below here...



Imports System

Imports System.Data

Imports System.Data.OleDb

Imports System.Collections

Imports System.Text

Imports System.Windows.Forms

Imports System.Environment



Public Class ScriptMain

Inherits UserComponent

Public rowCount As Integer

Public Connections As New Connections(Me)


Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)


rowCount += 1

End Sub


Public Overrides Sub PostExecute()

'add to global variables


Variables.TotalRecordCount += rowCount

Dim stb As StringBuilder

stb = New StringBuilder

stb.Append(String.Format("<BalanceData ProgramName=""{0}"" JobName=""{1}"" CycleCode=""{2}"" >", "PST020", Variables.JobName, Variables.CycleCode))

stb.Append(String.Format("<BalanceLog BalanceItemId=""10040"" BalanceNumber=""{0}"" />", rowCount))

stb.Append("</BalanceData>")

With New OleDbCommand("dbo.uspInsertBalanceLog")

.CommandType = CommandType.StoredProcedure

'Define the common parameters

.Parameters.Add("@balanceLog", OleDbType.VarChar, 4000).Value = stb.ToString()

'Define and open the database connection

.Connection = New OleDbConnection(Connections.Prostar.ConnectionString)

.Connection.Open()


Try


.ExecuteNonQuery() 'Execute the procedure

Finally 'Always finalize expensive objects

.Connection.Close()

.Connection.Dispose()

End Try

End With

MyBase.PostExecute()

End Sub

End Class

Can tell me what the issue could be...

View 4 Replies


ADVERTISEMENT

SSIS Script Component Error

Mar 28, 2008



I cannot open my script component in my SSIS package. Not sure if this is the cause, but I originally designed the package in BIDS and now have loaded Visual Studio 2005. Here are all the error messages:

===================================
Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%u00ae+Visual+Studio%u00ae+2005&ProdVer=8.0.50727.762&EvtSrc=Microsoft.DataTransformationServices.DataFlowUI.SR&EvtID=CouldNotShowVsaIDE&LinkId=20476
===================================
Engine returned Unknown Error (Microsoft.VisualBasic.Vsa)
------------------------------
Program Location:
at Microsoft.VisualBasic.Vsa.VsaEngine.LoadSourceState(IVsaPersistSite Site)
at Microsoft.SqlServer.VSAHosting.DesignTime.LoadEngineSource(String engineMoniker, String project)
at Microsoft.SqlServer.Dts.Pipeline.ScriptDesignTime.CreateDesignTimeEngine(String projectName, Boolean loadSource, ICodeGenerator codeGenerator)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ShowIDE()
at Microsoft.DataTransformationServices.DataFlowUI.ScriptUI.propPage_DesignScript(Object sender, EventArgs args)
===================================
A project with the name 'ScriptComponent_96f4738414c440d0b240beb6399cef36' already exists.
------------------------------
Program Location:
at Microsoft.Vsa.IVsaEngine.LoadSourceState(IVsaPersistSite site)
at Microsoft.VisualBasic.Vsa.VsaEngine.LoadSourceState(IVsaPersistSite Site)

Any help in solving this would be appreciated.

Thanks
David

View 16 Replies View Related

SSIS Script Component Error With PostExecute

Dec 18, 2007

Hi,

I have a Script Component that needs to read values from a User Variable in PreExecute, modify the values and write them back to the Variable in PostExecute.

The Problem is it works just fine in DEV environment where only the SSIS tools are installed but not the service. But it failes with error in Test enviroment.

Error No: -1073450910.
----------------------
Error Desc: System.Runtime.InteropServices.COMException (0xC001404D): Exception from HRESULT: 0xC001404D
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PostExecute()
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPostExecute(IDTSManagedComponentWrapper90 wrapper)
---------------------


Here is the code:



Public Overrides Sub PreExecute()

Dim vars As IDTSVariables90

Me.VariableDispenser.LockOneForRead("PrevMember", vars)

m_sPrevMember = vars.Item("PrevMember").Value.ToString

vars.Unlock()

Me.VariableDispenser.LockOneForRead("PrevNoteSeq", vars)

m_iNoteSeq = CInt(vars.Item("PrevNoteSeq").Value)

vars.Unlock()

MyBase.PreExecute()

End Sub



Public Overrides Sub PostExecute()

Dim vars As IDTSVariables90

Me.VariableDispenser.LockOneForWrite("PrevMember", vars)

vars("PrevMember").Value = m_sPrevMember

vars.Unlock()

Me.VariableDispenser.LockOneForWrite("PrevNoteSeq", vars)

vars("PrevNoteSeq").Value = m_iNoteSeq

vars.Unlock()

MyBase.PostExecute()



End Sub


Any idea what the problem is?
Is there any other way i can accomplish this?

Thanks.

View 7 Replies View Related

SSIS Package Designer Lookup Component GUI Error?

Jul 5, 2006

Has anybody seen this issue already?

If you try to "enable memory restriction" from the Lookup component GUI you need to input both 32 and 64 bit size of maximum memory. However when clicking "OK" on the editor you get a message like :

TITLE: Microsoft Visual Studio
------------------------------

Error at Update Execution Logs [Lookup folder path 1 [4429]]: Failed to set property "MaxMemoryUsage64" on "component "Lookup folder path 1" (4429)".



------------------------------
ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC0204006 (Microsoft.SqlServer.DTSPipelineWrap)

------------------------------
BUTTONS:

OK
------------------------------


You can only set the properties directly for mthe Properties window (F4).

I think this is a post SP1 bug in Visual studio designer...



View 5 Replies View Related

Use Of A SSIS Variable Of Type “Object� Inside Script Component And Task Component

Mar 16, 2007

In a Data Flow, I have the necessity to use a SSIS variable of type €œObject€? inside Script Component and assign to it the content of 'n' variables of string type.
On exiting from the script the variable of type object should contain something like in the following lines:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
DDDDDDDDDDDDDDDDDDDDDDDDDDDDD
€¦€¦€¦€¦€¦€¦€¦.
€¦€¦€¦€¦€¦€¦€¦.
On exiting from the data flow I will use the variable of type Object in a Script Task, by reading each element in a cyclic fashion.
Is there anyone who have experienced something like this? Could anyone provide any example of that?
Thanks in advance!

View 3 Replies View Related

A Custom Component For Use As A VIEW In SSIS- Is It Possible To Create One MERGE Like Component With More Than 2 Inputs

Aug 13, 2007

Hi all
I'm into a project which uses a lot of views for joining 2 or more tables. Using the MERGE component in SSIS will be a huge effort coz it only has 2 inputs and I gotta SORT the input too.
Isnt it possible to have a VIEW like component that joins more than 2 tables and DOESNT need sorting??
(I've thought about creating views in database engine but it breaks my data floe in SSIS and is'nt a practical solution)

View 4 Replies View Related

Integration Services :: SSIS Script Component Source Failing With Error

Aug 28, 2015

we need download files from FTP location , so we are using script component as source  and when we are using the fallowing code// read a file and write out as columns in rows

WebClient myWebClient = new WebClient();
myWebClient.Credentials = new NetworkCredential(Variables.ftpLogin, Variables.ftpPassword);

// Concatenate the domain with the Web resource filename.
string myStringWebResource = Variables.fileURL + Variables.fileName;

string s = myWebClient.DownloadString(myStringWebResource);
StringReader reader = new StringReader(s);

we are getting the fallowing error  The server returned an error: (404) Not Found. are we missing anything in the code.

View 2 Replies View Related

Error: The Product Level Is Insufficient For Component, While Executing SSIS Package

Jul 28, 2006

While executing SSIS package from command prompt as follows:

dtexec.exe /DTS "MSDBetl-hyundai-package" /SERVER tvmwindev02 /CONNECTION "TVMWINDEV02.HISNA_POC";"Data Source=TVMWINDEV02;In
itial Catalog=HISNA_POC;Provider=SQLOLEDB.1;Integrated Security=SSPI;Auto Translate=False;" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING E /CONSOLELOGO

while executing the package following error message is received as :

Error: 2006-07-28 15:12:36.60
Code: 0xC00470FE
Source: Data Flow Task DTS.Pipeline
Description: The product level is insufficient for component "Data Conversion" (202).
End Error

and at the end as :

DTExec: The package execution returned DTSER_FAILURE (1).

Same error appers while executed from Integration Services - ->stored packages - - >name of the package -> mouse right button, run package.

But the same executes perfectly from visual studio, where it is developed.



what could be the reason?

View 6 Replies View Related

Error While Trying To Assign A Value To A Read Write Variable In SSIS Package Script Component

Sep 26, 2006

Hi,

       I am trying to develop a SSIS package which will read the records from the flat file and insert them into a destination table. I have some validations written in script component. I have declared two Read Write variables with package level scope. when i try to assign a value to the variable in the script component and run the package, the package throws me an error "The collection of variables locked for read and write access is not available outside of PostExecute".

 

What should be done to over come the problem please help me on this regard 

 

Thanks

Madhavan.M

View 15 Replies View Related

SSIS Execution Error: The Product Level Is Insufficient For Component Data Reader Source

Jun 5, 2007

Hi all, while executing my ssis package Im getting this error

" the product level is insufficient for component "data reader source" "



but through the bussiness intelligence while debugging it was executing successfully,

but only after deploying the package on to the IS server, while executing getting this error

I checked with the server version also, its was with service pack 2



can I get any help



thanks in advance



View 1 Replies View Related

SSIS Package Execution Error: Retrieving The COM Class Factory For Component With CLSID {E44847F1-FD8C-4251-B5DA-B04BB22E236E}

Mar 6, 2008



Hello Chaps,

I am using vb.net 2005 and SQL Server 2005.. I have deployed some of my packages on the server.. Now if i am trying execute packages with SSIS object model from any of developement PC they are executing perfectly. But as soon as i am trying to execute them from client pc - where no any component except (.netframwork) -- i am getting the follwoing error:


Retrieving the COM class factory for component with CLSID {E44847F1-FD8C-4251-B5DA-B04BB22E236E}

Can any one help me out..? i have gone through some of the article stating that SQL client componet must be installed on the computer from where app runs...

Is there any other solution to use SSIS object model...

Let me know if any one you have...!

Thanks,
Tarang Pandya

View 4 Replies View Related

The Component Metadata For Component DataReader Source (1113) Could Not Be Upgraded To The Newer Version Of The Component.

Oct 26, 2007

Hello,

I have a package that has a data lfow task. this task imports data from a db2 database (using the IBM Ole DB provider fro db2) and adds it to sql server database table. This package was created on the server. then though version control (using TFS source control) I check out the package on my local machine. and when I open the package I get the foll 3 errors.

Error 1 Validation error. Import Account Num from BMGP_BDR: DTS.Pipeline: The component metadata for "component "DataReader Source" (1113)" could not be upgraded to the newer version of the component. The PerformUpgrade method failed.

Error 2 Error loading BMAG Download Xref Tables - bmag.dtsx: Microsoft.SqlServer.Dts.Pipeline.ComponentVersionMismatchException: The version of component "DataReader Source" (1113) is not compatible with this version of the DataFlow. [[The version or pipeline version or both for the specified component is higher than the current version. This package was probably created on a new version of DTS or the component than is installed on the current PC.]] at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostCheckAndPerformUpgrade(IDTSManagedComponentWrapper90 wrapper, Int32 lPipelineVersion)

Error 3 Error loading BMAG Download Xref Tables - bmag.dtsx: The component metadata for "component "DataReader Source" (1113)" could not be upgraded to the newer version of the component. The PerformUpgrade method failed.


Please advice.
Thank you.





View 7 Replies View Related

Enable Error Handling When Writing Custom Source Component /custom Error Handling Component.

Apr 21, 2006

1) We are writing a custome Source component for Oracle with OCI calls, Could some one please let me know how to Enable Error Handling for the Same,

2) Is it possible to write Custome Error Handeling Component for SSIS? if yes could you please help me on how to write it.

Thanks in advance.

View 1 Replies View Related

The Component Metadata For Component DataReader Source Could Not Be Upgraded To The Newer Version Of The Component.

Jan 23, 2007

Hi,

I have a package which reads an Access file from a folder. My connection manager to this file is .NET providers for OledbMicrosoft Jet 4.0 OLE DB Provider.

Package works from my computer. But when I execute it on the server as a SQL Agent job, I get







The component metadata for "component "DataReader Source" (1) could not be upgraded to the newer version of the component. The PerformUpgrade method failed.  

I copied the mdb file to a folder on the server which my packages have no problem reading data from.

My packages run under the same domain account as defined in proxies.

Appreciate a help.

Gulden

 

 

View 4 Replies View Related

If-then-else-component In SSIS

Nov 23, 2007

Hi all,

i am not very experienced with the SSIS. I am just wondering if there is something like a "if-then-else"-componente like the foreach-component in SSIS.

I want to delete the values of all tables in one database. So I took a foreach-component and selected the smo-enumeration with all tables. I store the tablename in a variable and execute a sql-task with "delete table.." with the variable tablename as parameter. Now I want to delete all except one certain table. I would like to add a selection where the variable tablename is checked. If the tablename is this certain table, I don't want to execute the sql-command, else I want to excecute the delete-command.

Are there any suggestions?

Thank you very much

Joachim

View 4 Replies View Related

SSIS Script Component

Feb 6, 2008

I have just migrated a DTS 2000 package
as an SSIS package.
one of the features that failed to migrate, was a transformation
that , selected 2 colums of data with a stored procedure,
file name, and full path of filename,
Then the file name only was written to a txt file,
Then there was an ActiveX transformation task that used the other
column (full file path) to copy said file to another location (specified as a global str variable eg \127.0.0.1directory..etc)

Now my question is this, with SSIS script task
can i save the path name (2nd column) to a variable and then
using this variable copy the file to another location (global str variable) ?
Is there a CopyFile function like there is in ActiveX ?

And can i add this script task along with the DATA FLOW ?
because if i add it outside the DF , it will only (im assuming) copy the last line (path) into the variable...

View 2 Replies View Related

SSIS Script Component

May 16, 2006

Dear all,

Such a pain, I know. Yesterday I did a couple of questions regarding transformation rows and very kindly I obtained answer (Thanks Jamie and Michael)
But now I face another stupid issue and is how to map source with destination columns inside Script Component Task.
On my Flat File Source I€™ve got defined thirteen columms (from Column0 till Column13); that€™s fine. And then, I€™ve got a sql table as destination with another names, of course€¦

Inputs and Outputs option from Script Component Editor leaf has been commited both (Input 0 and Output 0) but I wonder how the hell I€™m refer to them here:

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)

** snippet of old code sql2 to migrate€¦

'If DTSSource("Col010") = "N" Then
' DTSDestination("ImpBase") = -1 * CDbl(DTSSource("Col011") / 100)
'Else
' DTSDestination("ImpBase") = CDbl(DTSSource("Col011") / 100)
'End I



.Net Script

If Row.Column10 = "N" Then
¿??????????????
End If

End Sub

Thanks a lot for your comments and thoughts,
Enric

View 16 Replies View Related

SSIS Script Component

Feb 6, 2008

I have just migrated a DTS 2000 package
as an SSIS package.
one of the features that failed to migrate, was a transformation
that , selected 2 colums of data with a stored procedure,
file name, and full path of filename,
Then the file name only was written to a txt file,
Then there was an ActiveX transformation task that used the other
column (full file path) to copy said file to another location (specified as a global str variable eg \127.0.0.1directory..etc)

Now my question is this, with SSIS script task
can i save the path name (2nd column) to a variable and then
using this variable copy the file to another location (global str variable) ?
Is there a CopyFilefunction like there is in ActiveX ?

And can i add this script task along with the DATA FLOW ?
because if i add it outside the DF , it will only (im assuming) copy the last line (path) into the variable...

View 1 Replies View Related

XML Parser Component For SSIS?

Jul 6, 2006

Informatica has an XML parser component that allows me to read an xml file from a data source (Oracle Clob attribute in table in this case), parse it out in our mapping, and then transform the parsed date.

Does anyone know if SSIS has similar functionality?


Flow:

DataSource --> XML Parser --> Expression Component (Transform) --> DataTarget

Thanks
Scott

View 5 Replies View Related

SSIS SCRIPT COMPONENT

Oct 11, 2006

Hello,

My SSIS design: Source OLE DB -> Script Component -> Destination OLE DB

I have a script component that reads and proceeds each row in input. But I have no rows in output. How can you explain that ? with the viewer, I see the rows in input but in output, I have nothing after the script.
The script function: read the value of the ROW.column and flag like this :
ROW.columnout = TRUE (columnout is added in output columns)

What should I define at the component to retrieve the rows after the script component ?

Thanks !

View 2 Replies View Related

Error: The ProcessInput Method On Component OLE DB Destination (513) Failed With Error Code 0xC0202009

Mar 22, 2007

I'm trying to create a simple Data transfermation. I have a flat file that came of a unix server.. it's 177 bytes wide.. thought it was 175, but when I created the flat file connector, I could see some extra characters on the end.



My output is going to be an excel spreadsheet, I only want two columns from the input. I created an oledb jet 4.0 connection. and followed instructions from here :

http://aspalliance.com/889_Extracting_Data_from_a_Flat_File_with_SQL_Server_2005_Integration_Services

to create my datafow.



On my first attempt to dataflow, I ran into unicode errors and had to do this:



ran into a problem with unicode errors. went to the source for the flat file. for the output column in question changed to Unicode string [DT_WSTR].



When I run , here are the errors I get:

[OLE DB Destination [513]] Error: An OLE DB error has occurred. Error code: 0x80040E09. [DTS.Pipeline]

Error: The ProcessInput method on component "OLE DB Destination" (513) failed with error code 0xC0202009. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.

[DTS.Pipeline] Error: Thread "WorkThread0" has exited with error code 0xC0202009.

[GanchoFileSource [1]] Information: The total number of data rows processed for file "\ammia01dev04D$JCPcpmgancho_venta_20070321.sal" is 19036.

[GanchoFileSource [1]] Error: Setting the end of rowset for the buffer failed with error code 0xC0047020.

[DTS.Pipeline] Error: The PrimeOutput method on component "GanchoFileSource" (1) returned error code 0xC0209017. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.

[DTS.Pipeline] Error: Thread "SourceThread0" has exited with error code 0xC0047038.


View 4 Replies View Related

[ActiveX Script Task] Error: Retrieving The File Name For A Component Failed With Error Code 0x001B6438.

Jul 28, 2006

This error occurs when the ActiveX task tries to execute:

[ActiveX Script Task] Error: Retrieving the file name for a component failed with error code 0x001B6438.

Anybody know how to troubleshoot these errors? I can't find anything on this error code. The same script works in DTS.







View 8 Replies View Related

SSIS, Script Component, How To Get ErrorColumnName

Feb 26, 2008



Hi All,

I am creating an SSIS Package where I need to get the errorcolumn name in a script component to be inserted into a database table.
Even when I loop through ColumnNames in ComponentMetaData.InputCollection(0).InputColumnCollection and match their lineageId with the errorcolumn, I dont get a match. Can anybody please help me in this.

Thanks in advance.

View 3 Replies View Related

Failing A SSIS Script Component

Mar 7, 2006

Hi

When there is an error in one of the rows a script component (in a child package) is processing I want to fail the child package and the parent package and not continue processing any rows.

How do I do this?

I have every thing in the script component in a try catch statment. This is the catch block

Catch ex As Exception

ErrorMsg = ex.Message + " " + RecordMsg + " Error on Column : " + ColumnMsg

ComponentMetaData.FireError(0, ex.Source, ErrorMsg, String.Empty, 0, False)

End Try

Also I have the FailPackageOnFailure and FailParentOnFailure properties set to true and the max errors value set to 0.

Any suggestions?

Thanks

View 3 Replies View Related

4 Errors When Using SSIS Scripting Component

Nov 7, 2006



Hi guys, I got these errors when writing a scripting component. Anyone encounteer these errors before?

Warning 1 The dependency 'EnvDTE' could not be found.
Warning 2 The dependency 'Microsoft.SqlServer.VSAHosting' could not be found.
Warning 3 The dependency 'Microsoft.SqlServer.DtsMsg' could not be found.
Warning 4 The dependency 'Microsoft.SqlServer.VSAHostingDT' could not be found.



-Daren

View 4 Replies View Related

Xml Ssis Data Flow Component?

Jul 2, 2007

There is a table with a column that contains Xml documents. For each record from my Data Flow Source, I want to pass in the Xml document and the node to interrogate, and return the value contained in the node. Like the Crm component, this is probably one I will have to write from scratch in C#, but I would like to avoid having to create the custom component if it already exists in the public arena.



Does anyone know of any Xml Ssis Data Flow Components that are downloadable for free?

View 3 Replies View Related

SSIS (2005) Script Component API

Jul 13, 2007

Hi

I have managed to programmatically create data flows and components in an SSIS (2005) project (*.dtsx) by using VS2005 VB.NET but I have hit a road block in terms of progarmmatically inserting pre-tested VB.NET code into a newly created Data Flow - Script Component source code block

Can someone give me a little bit of direction on this? Is it possible? Direction to some example code would be great!

Thanks in advance

Wayneiz

View 4 Replies View Related

SSIS: First Time Script Component

Nov 29, 2006

Hello,

I have a flat file that contains detail in each record as indicated below:


HEADER_ID, ATTRIB_A(1..10), ATTRIB_B(1..10), ATTRIB_C(1..10), etc.

The index of the attribute relates it to other attributes with the same index. It needs to look like this in the detail table:


HEADER_ID, ATTRIB_A1, ATTRIB_B1, ATTRIB_C1

HEADER_ID, ATTRIB_A2, ATTRIB_B2, ATTRIB_C2

I need to pivot these attributes into a detail table that relates back to the header information. Because of the number of these, I don't want to use the UNPIVOT Task because there are so many. I was hoping to move the complexity to a Script Component where I could read one line and transform it to a normalized state.

Can someone point me in the right direction?

Thanks.

View 6 Replies View Related

Any Idea To Implement SCD Without SCD Component Of The SSIS

Dec 21, 2007

Hi All,
I would like to say thank you in advance for all your ideas. Here is my case i want to implement slowly changing dimension, i know that i can use SCD component of the SSIS, but because of performance issue i am thinking to use something else that can subtitute the SCD component, i want some idea from you guys if anyone has implemented before without Slowly Changing Dimension component.
If not, do you have any comment/suggestion to use the SCD component i mean if the worest comes and i use it, what draw backs does it has, for example interms of data size, performance. Note that i use Dedicated Server for the ETL in Production.

Thank you

SamiDC

View 8 Replies View Related

SSIS ODBC Source Component

Apr 24, 2006

I need to create an ODBC source script component that outputs into SQL Server. When I debug I get the following error message:

Error at Data Flow Task [Script Component [1]]: System.InvalidCastException: Unable to cast object of type 'System.Data.Odbc.OdbcConnection' to type 'System.Data.SqlClient.SqlConnection'. at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e) at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.AcquireConnections(Object transaction) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper90 wrapper, Object transaction)Error at Data Flow Task [DTS.Pipeline]: component "Script Component" (1) failed validation and returned error code 0x80004002.

Here the problem code:


Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Math
Imports System.IO
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper

Public Class ScriptMain
Inherits UserComponent
Dim connMgr As IDTSConnectionManager90
Dim sqlConn As SqlConnection
Dim sqlReader As SqlDataReader

Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
connMgr = Me.Connections.PP
sqlConn = CType(connMgr.AcquireConnection(Nothing), SqlConnection)
End Sub

Public Overrides Sub PreExecute()
Dim cmd As New SqlCommand("SELECT Solution_Code_From, Solution_Code_To FROM Solconv", sqlConn)
sqlReader = cmd.ExecuteReader
End Sub

Public Overrides Sub CreateNewOutputRows()
Do While sqlReader.Read
With SolutionOutputBuffer
.AddRow()
.solcodefr = sqlReader.GetString(1)
.solcodeto = sqlReader.GetString(0)
End With
Loop
End Sub

Public Overrides Sub PostExecute()
sqlReader.Close()
End Sub

Public Overrides Sub ReleaseConnections()
connMgr.ReleaseConnection(sqlConn)
End Sub

End Class

Would appreciate any advice.

Thanks in advance,
Pozzled

View 9 Replies View Related

SSIS Script Component To Concatenate Field

Jun 28, 2007

Is there a Data Flow Transromation in SSIS to take multiple columns from an excel sheet and concatinate them into one filed.

Ex:
'Strt-Address', 'City', 'State' into 'HomeAddress'.

I could dump them into a temp table and concatinate the fields and insert that into the destination but that seems like a waiste of using SSIS.

Thanks

View 1 Replies View Related

Can I Use Db Mail Component Of SSIS On Migrated DTS Package ?

Dec 10, 2007

Hi

I had a DTS package on sql2000 which i migrated succesfully to Sql2005 and im able to open the package and execute the package.Now i want to add a new database mail component on this package to send emails to recepients.In short i dont want to use SQL Mail component of Sql2000 which required outlook components,instead i want to use the new features of SSIS to my package which was designed on sql2000.
Is it possible to use the SSIS new features to be incorporated on my old DTS package?

Thanks in advance
Regards
Arvind

View 1 Replies View Related

Can Custom Properties In A SSIS Component Be Disabled

Feb 26, 2008

Is there a way of disabling a custom property in a component so that during design-time the property is grayed out? I looked around the properties of IDTSCustomProperty90 and nothing sticks out.

Thanks
Mike

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved