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

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

How to modify OLEDB SQLCommand from Script Task in SSIS 2008

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :Sql Server

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.






View Complete Post

More Related Resource Links

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?

Output parameters in OLEDB Command component - SSIS 2008

I have a package that I developed in SSIS 2005 and recently ported to 2008. Everything runs great except an OLE DB Command component that calls a stored procedure that uses output parameters. When I try to run this, I get this error: Error: 0xC0202009 at Data Flow Task, OLE DB Command [100]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Syntax error, permission violation, or other nonspecific error". Error: 0xC004701A at Data Flow Task, SSIS.Pipeline: component "OLE DB Command" (100) failed the pre-execute phase and returned error code 0xC0202009. When I do the same thing in SSIS2005, it works fine. So I setup a new package with 1 data flow. In that data flow, I added a source component, an OLE DB Command, and a destination.  I then tested this with a stored procedure that took no parameters. It worked fine. I then tested it with a stored procedure with 1 parameter defined as OUTPUT. This generated the error.   Is there an issue with output parameters in an OLE DB Command in SSIS 2008?   Thanks!http://bobp1339.blogspot.com

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/> [

Access the SQL Command Query Value Property from the OLEDB Container within a Script Task

Hello, I'd like to Access the SQL Command Query Value Property from the OLEDB Container within a Script Task so I can audit the queries which are executing. What is the syntax for this or does anyone have a sample on how to do this? Thank you

Post Upgade task, Upgrading SSIS Pacakges to SQL Server 2008.

Hi, I am trying to upgrade sql 2005 packages to sql 2008 after doing in-place upgrade of DE and SSIS. Can I know what packageformat column in msdb.dbo.sysssispackages refer to, as according to http://msdn.microsoft.com/en-us/library/cc879336.aspx the value should be 2 if the package is in sql 2005 and it should be 3 if it is upgraded. But I am seeing only 0 or 1.   Can I know any other method to figure out version of the ssis packages? I am having issues upgrading SSIS Packages from 2005 to 2008, using SSIS package upgrade wizard.   Thanks for your help. Regards, KRanp.

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 - Web refrerences do not add at first or second attempt

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?    

SQL Server 2008 Script Componant Error - [SSIS.Pipeline] Error: component "Script Comp Name" (48) fa

Hi All,   I am facing one strange issue in SSIS 2008. I have developed one SSIS package which is importing excel data into SQL Server 2008. This Package contains some Scirpt componants. This package is working fine on Windows XP machine but when I am trying to run on Windows 2003 server it gives me error "[SSIS.Pipeline] Error: component "SCR RDSTableRelation" (48) failed the post-execute phase and returned error code 0x80004002". Surprising thing is that if on windows server 2003server  if I drag a new script componat and paste the previous script code itself then it works fine. Even if I copy-paste the existing script componant and give source-destination connectino to this new script componant then also it works.

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!

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
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