Questions tagged [script-task]

The Script task provides code to perform functions that are not available in the built-in tasks and transformations that SQL Server Integration Services provides. The Script task can also combine functions in one script instead of using multiple tasks and transformations. You use the Script task for work that must be done once in a package (or once per enumerated object), instead than once per data row.

Do not use this tag for the SSIS Script Component, instead use .

Check the following article for more information: SSIS Script task vs. Script Component


Based on the official SSIS documentation, SSIS tasks are categorized as the following: Data Flow Task, data preparation tasks, workflow tasks, SQL Server tasks, Analysis Services tasks, maintenance tasks, custom tasks, and scripting tasks.

The SSIS Script Task extends the package functionality by using scripts. It performs functions that are not provided by the standard Integration services tasks.

363 questions
4
votes
2 answers

SSIS: Programmatically create new Excel file based on web query results - how do I save the web query table names?

What am I trying to do? I have a list of URLs that I want to scrape using Excel's Web Query functionality. I'm trying to completely automate the process, so I'm developing an SSIS package that calls a Script Task for each URL. The Script Task…
digital.aaron
  • 5,435
  • 2
  • 24
  • 43
4
votes
1 answer

SSIS renaming files in a directory using script task

I am using the below code, to rename all the files in a folder with a timestamp. But it is throwing an exception. Please suggest any solutions. using System.IO; public void Main() { DirectoryInfo directoryInfo = new…
4
votes
1 answer

How do I use DTS.Events.FireInformation() in SSIS Script Task while handling WinSCPnet.dll FileTransferProgress?

I have a Script Task in an SSIS (2008) package that downloads files from a remote FTP server to a local directory. The Script Task is written in C# 2008, and uses WinSCPnet.dll. Using examples from WinSCP's documentation, I came up with the script…
digital.aaron
  • 5,435
  • 2
  • 24
  • 43
4
votes
2 answers

"Cannot execute script because the script entry point is invalid" error in script task in SSIS

I am trying to upload files from my local folder to SFTP using SSIS Script Task. On replicating the script from https://winscp.net/eng/docs/library#csharp I get an error Error: Cannot execute script because the script entry point is invalid.…
mehtat_90
  • 586
  • 9
  • 29
4
votes
2 answers

SSIS read-only variable get changed

I have a package, inside which I have two components: First is a SQL task to execute and get an ADO result set, the second one is a script task, I convert the result set to System.Data.DataTable twice, something like that: System.Data.DataTable t1=…
a4194304
  • 366
  • 2
  • 13
4
votes
3 answers

Cannot load script for execution

I am getting an error message in VS studios when I try to execute a script task using C# code. The code opens in the editor and will build and rebuild successfully but when I run the package I get "Cannot load script for…
Matthew Nelson
  • 105
  • 1
  • 8
4
votes
2 answers

SSIS Script Task with Read/Write Variables doesn't stop on ScriptResults.Failure

If I don't pass any variables to the script task, I can make it fail or succeed by setting the Dts.TaskResult. But When I pass some read/write variables, I can't make it fail (keeps executing forever), but I can still make it succeed. Am I missing…
Sumanasa
  • 153
  • 1
  • 7
3
votes
1 answer

How to execute SqlCommand using OLEDB connection in SSIS script component

I am using SSIS 2019 and am able to execute SQL Command with ADO.Net Connection Manager. I want to use OLEDB connection manager in a Script component within a Data Flow Task and I am getting the below error: System.InvalidCastException: Unable to…
AMDI
  • 895
  • 2
  • 17
  • 40
3
votes
3 answers

C# SSIS Script Task - Add Thousand Seperator when formatting Excel column

Currently using the following C# in a script task in SSIS to format an Excel column as a Number. sheet.Columns[6].NumberFormat = "0.00"; However when the column is created the thousands separator is missing. Is there a way to add this in?
OllieSP
  • 45
  • 5
3
votes
1 answer

Exception has been thrown by the target of an invocation - While executing a .dtsx file in Visual studio

I have developed an ssis package and i have a script which fetches few text command from a .txt file , stores those in variables and i use those variables to see what to do next and which dft to execute. When i go to the .dtsx file--> right click-->…
TheSacredKiller
  • 121
  • 3
  • 8
3
votes
2 answers

SSIS Package not running from server

I have an SSIS package that does the following; Detects if a file (excel exists) Deletes file Copies file from a directory into the required one This package when run locally to test functions correctly there are no issues. When running on server…
user2261755
  • 159
  • 1
  • 3
  • 17
3
votes
3 answers

Convert DTS.Variables of type System.Object into a list

I have an SSIS package that executes a SQL task in order to get the names of servers I need to connect to. Then, the results of that query are stored in an variable object called "servers". I then want to run another package on each server at once,…
3
votes
2 answers

Replace Script Task In Multiple SSIS Packages

Custom Script Task Needs Replacing In Many SSIS Packages. We can do it manually, but there is 170 packages, need to automate. Code works so no issues. When manually replaced, script task shows no errors. Hello, I have about 170 packages in SSIS. I…
DrDuran
  • 101
  • 1
  • 3
  • 12
3
votes
1 answer

How to extract date only from a file name using C#

I have a situation where I need to extract dates from the file names whose general pattern is [XXXX_BBBB]_YYYY-MM-DD[.fileExtension] example Sales_person_2019-05-03.xlsx. I am using c# in the SSIS script task component to achieve this. below is my…
3
votes
1 answer

Import more than 255 Characters from excel to sql server (previous question - how to load text qualifed CSV dynamically to sql server using ssis)

I have a CSV file which has salesforce data and is generated using python API call and i am trying to load the file in MS SQL DB using SSIS. I need a C# script to rectify the issue because the data is not consistent (no of columns and order of…
1
2
3
24 25