.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

SSIS - Script task - Web refrerences do not add at first or second attempt

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :Sql Server
Problem happens on 3 different PC's with BIDS installed.   Steps to reproduce: - New SSIS project - Drop Script Task - Edit its code - Add Web Reference - Specify a web service and click add reference - Close script task code editing window - Open script task code editing window - Reference is gone - But you CANNOT add another reference with the SAME name, it will get "1" at its end! - Try to add same web refernece again, it will have "1" at its end - Close script task code editing window - Open script task code editing window - You have 50% chance for reference to stay, 50% chance that it will disappear AGAIN! - But you now cannot add another reference with name or name1! - Try to add same web reference AGAIN and it will have 2 at its end - Close script task code editing window - Open script task code editing window - I have never got the reference2 to disappear... yet Please can someone just tell me... WHAT THE ... IS HAPPENING?    

View Complete Post

More Related Resource Links

C# newbie stuck - trying to access column data in a SharePoint list in an SSIS script task

Hello, I'm sure this is the simplest question but I can't figure it out, even with Google's help. I am trying to stumble through some C# code in an SSIS script task and I am frustrated that I can't figure out how to do the easiest things.  I eventually want to find data in a column,and then use another list as a lookup to replace that value with another where the existing value matches a value in the lookup list.  So, the data in my (multiple choice) column might be "apples; bananas" and in another list I have a row that contains two columns, the first holding the value "Apples" and the second containing "Red Delicious" and my original column should read: "Red Delicious; bananas." But, alas, I can't even figure out how to see the data that is in a column. Here is my code: /*<br/> Microsoft SQL Server Integration Services Script Task<br/> Write scripts using Microsoft Visual C# 2008.<br/> The ScriptMain is the entry point class of the script.<br/> */<br/> <br/> using System;<br/> using System.Data;<br/> using Microsoft.SharePoint;<br/> using Microsoft.SqlServer.Dts.Runtime;<br/> using System.Windows.Forms;<br/> using Microsoft.SharePoint.Utilities;<br/> <br/> namespace ST_08becda4c05c49cd9f30ea76110076cd.csproj<br/> {<br/> [

SSIS Script Task

I am trying get user input from a form created via script but the form flashes on the screen and then disappear...is there a special implementation for this?? The following code is in my main; FormIU   from = new FormIU();   from.Show();    

Insert error description in sysjobhistory from ssis script task

hi. in ssis i have script task that, in some situations, raise error (Dts.TaskResult = ScriptResults.Failure). But in sysjobhistory table there is only shor description what happend (Description: The script returned a failure result.). Is there any way that i can set some system variable to describe what is error so that description ens up in sysjobhistory table? in the end, i want to look in job activity monitor and see that job is "red" and see the description that couses this failure.

Error Trapping in SSIS Script Task

Hi, I am processing a cube partition using an SSIS script task. The script works out the name of the partition which requires processing based on the system date.The problem I have is whenever there is a failure in the processing task the only error I get is that the script task returned a failure result. This is reported by the SQL job that calls the script task and also by SSIS package logging. I am running SQL2005 SP3How can I get my script to return a meningful error? Thanks in advance.

SSIS Script Task

Can I use a script task to recieve two date values to start a SSIS package? if so, how do I implement this?

SSIS Script Task wait for remote process completion - WMI & C#

Hi All: I have a C# script task that uses WMI to create a process on a remote machine. What is the best way for me to make the script task wait until the remote process has completed before moving to the next task in SSIS? TIA!

Writing XML data from URL to Object in SSIS Script Task

I have this URL where there is XML data. I have to extract that data from URL and dump it into DW table. I am using SSIS Script Task for that.

This is how the data looks like:
<cname>United Arab Emirates Dirhams</cname>
<cname>Afghanistan Afghanis</cname>
<cname>Albania Leke</cname>

This is the code i'm using to load it into some Object type or something. But i dont know how to do that.

public void Main()
   String URLString = "http://www.xe.com/dfs/datafeed2.cgi?beeline";
   XmlDocument doc = new XmlDocument();
   XmlTextReader reader = new XmlTextReader(URLString);

   XmlNodeList currencynodes = doc.SelectNodes("currency");
   foreach(XmlNode currency in currencynodes)
    XmlNode csymbol = currency.SelectSingleNode("csymbol&quo

SSIS Script task design script problem



  I have placed a script task in my SSIS project, package.

When I click Design Script button, script editor is not opening, instead its returning to Control Flow. But no error.

 What is the problem?

I just created a new folder in D:\ drive with the name My SSIS. 


SSIS Script task that FTP's files


I could not find the exact details on how to create a SSIS script that would ftp files on these forums, so I am adding my code to help save time for anyone else that might be wanting to do something similar.  Here is the VB code for my script task to FTP files (hope this helps someone):

' Microsoft SQL Server Integration Services Script Task

' Write scripts using Microsoft Visual Basic

' The ScriptMain class is the entry point of the Script Task.

Imports System

Imports System.Data

Imports System.Math

Imports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMain

Public Sub Main()


'Create the connection to the ftp server

start SSIS package via script task with package configuration via variables



it is possible to start ssis packages with dtexec and set variables as package configuration like this:

dtexec.exe /SQL "\mart1\import_fact_calls" /SERVER "R08" /SET \package.variables[FullImport].Value;True

Now I'm trying to start a package via script task with this code:

Public Sub Main()
    Dim pkg As New Package
    Dim app As New Application
    Dim pkgResults As DTSExecResult

    If Dts.Variables("package").Value <> "" Then
      pkg = app.LoadFromSqlServer(Dts.Variables("package").Value, "R08", "USER", "PASS", Nothing)
      pkgResults = pkg.Execute()
    End If

    Dts.TaskResult = ScriptResults.Success
End Sub

How can I add a package configuration like the one with dtexec to the script code?

I like any ideas, links, docus ... Thanks!

trying to use custom assembly with script task in SSIS 2008 - can't find correct version of GACUtil


I am trying to use a custom assembly (compiled with VS 2005 framework 2.0) with SSIS 2008.  I understand that I need to put this Assembly in the GAC.  I initially attempted to do this using the GACUtil, but I apparently only have version 1.1 of GACUtil intalled on my development PC.  Shouldn't version 2.0 have been installed as part of VS 2005? 

So I then tried simply copying the dll into the GAC folder using windows explorer.  Well, the dll is now visibly in the GAC folder, but I cannot see it from either VS 2005 or BIDS 2008.  Does that mean I do need to use GACUtil 2.0 or higher to install the DLL into the GAC?  If so, is there any place on the Web that I can download it?

How to modify OLEDB SQLCommand from Script Task in SSIS 2008


I have to upgrade from SQL Server 2000 DTs to SSIS 2008. The DTS modify the dtspumptask dinamically. I dont now hot to do the same. I tried to do the same with variables but queries have more than 4000 characters.

Help please.






How to generate an excel and send it as email attachment in SSIS 2005 Script Task Component?


I am using a "Script Task" component. I am trying with following three simple steps:

1) Obtain the excel content in HTML

Dim reportInHtml As String = GenerateHTMLReport()

2) Generate an excel with below code:

Dim message As MailMessage

message = New MailMessage(fromAddress, toAddress, subject, String.Empty)

Using memoryStream As MemoryStream = New MemoryStream()

        Dim contentAsBytes As Byte() = Encoding.UTF8.GetBytes(reportInHtml)
        memoryStream.Write(contentAsBytes, 0, contentAsBytes.Length)
        memoryStream.Seek(0, SeekOrigin.Begin)

        Dim contentType As ContentType = New ContentType()
        contentType.MediaType = "application/ms-excel"
        contentType.Name = "Excel_Report.xls"

        Dim excelAttachment

Can't find "Analysis Management Objects" in SSIS Script Task reference



I am trying to connect to an Analysis services cube through my script task. To achieve this, i will have to use the Microsoft.AnalysisServices namespace. For this, I need to add a reference in my Project explorer space, to "Analysis management Objects" . However, I am not able to find this. Does any one know where I can find the dll file required for this, or why it's not showing in the 'Add Reference' of my script task?



--Mark the thread as answered if one of the replies answers your question. Thank you

SSIS Error in Script task: "Conversion from string "C002" to type 'Integer' is not valid"


Hi All,

I have a script component in my Dataflow that generates Error Description string.

But I am not trying to convert anything in my Script as you can see below.

Here is the Code inside the SCR_component.


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

Public Class ScriptMain
    Inherits UserComponent
    Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
     'Use the incoming error number as a parameter to GetErrorDescription
    Row.ErrorDescription = ComponentMetaData.GetErrorDescription(Row.ErrorCode)
   End Sub
End Class


When I run the package , it fails at this script task with the following error:

Description: System.InvalidCastException: Conversion from string "C002" to type 'Integer' is not valid.


The value "C002" is actually a column in the metadata and its type is "DT_STR". I am not trying to convert it in my Script as you can see

SSIS Script Task 08 - Edit Task


Upgraded to SQL 08  and updated my packages to SSIS 08 but I cant edit . The package runs and I able to edit all the other components except SCRIPT Task. It runs on Server '08. The packages works great on server 05, sql 05 .

Reinstalled VS 08 thrice ,SQL 08 once.. 

Below is the error 


TITLE: Microsoft Visual Studio



Cannot show Visual Studio 2008 Tools for Applications editor.





The VSTA designer failed to load:  "System.IO.FileNotFoundException: 

Retrieving the COM class factory for component with CLSID 

{7525139F-BB6B-447A-A81E-360B2197C3B2} failed due to the following error: 8007007e.

   at Microsoft.SqlServer.VSTAHosting.VSTAScriptingEngine.EnsureDTEObject()" 



Any Ideas ??

SSIS 2005 - Multiple data flows from a Script task


I have a variable that the user sets to an excel file. Because the file can be of a different version of Excel, I'm testing the version first in a script task. Depending upon the version I then want to call a specific DataFlowTask and also want to set the connection Manager accordingly for that DataFlow task.

i.e. if XLS extension then use the DataFlowTask with the Excel OLEDB Provider setting the connection to the variable passed.

if XLSX extension then use the DataFlowTask that uses the Office OLDEDB Provider with the Extension of Excel 12.0 again using the Variable passed as the connection setting.

An example on how to achieve this would be good.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend