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
3
votes
2 answers

newtonsoft json package requires reinstall every time i open code

I'm writing C# code in a script task in SSIS. I need to use the Newtonsoft JSON package in the code so i have installed it from NuGet. When it is first installed it works fine, but when I close my code and re-open it to make a change, I have to…
JBirrer
  • 171
  • 3
  • 13
3
votes
1 answer

SSIS Script Task with Microsoft.Exchange.WebServices

This is a possible duplicate question of this post, however my error is different and far less readable. Right now, I have an SSIS package that only contains a script task. Inside of that script task, I have Microsoft.Exchange.WebServices.dll…
Darryl Huffman
  • 2,499
  • 3
  • 18
  • 40
3
votes
1 answer

How to solve "Runtime error Exception has been thrown by the target of an invocation" Am I missing a DLL file?

I'm doing some testing which outputs the full result set into script task (display messagebox) from Execute SQL Task using Foreach loop Container. but running into DTS Script task: runtime error. Error Message box Am I missing some sort of DLL…
cwowswag
  • 31
  • 1
  • 3
3
votes
1 answer

Insert Record at the top of Excel

Hi I have this C# code and it is working well: string fileFullPath = Dts.Variables["User::ExcelFileFullPath"].Value.ToString(); //Create Excel Connection ConStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +…
Pablo Gûereca
  • 725
  • 1
  • 9
  • 23
3
votes
1 answer

OutOfMemoryException while trying to read big Excel file into DataTable

I'm using SSIS package to clean and load data from .Xlsx file to SQL Server table. I have also to highlight cells containing wrong data in .Xlsx file, for this I have to get back column and row indexes based on column name and row id(witch I have…
MedEc
  • 169
  • 1
  • 14
3
votes
2 answers

SSIS Script Task supress onerror

I have a script task which downloads a file using a HTTP connection object. This script task is part of a package which is called by another package. Sometimes the connection cannot be established. In these instances I want to retry the connection a…
3
votes
1 answer

C# code disapeared from script task after saving with "There is a compilation error. Do you want to save anyway" message

I am using VS2015 for SSIS development. My package consists of a script task which is very complex (has a number of classes and tricky logic). I made some modification to a class (in the script task), saved the modification, and wanted to close…
3
votes
2 answers

Having issues importing Excel data into existing SQL Server table using SSIS script task (VB)

I have successfully loaded the datatable object with data from the table in the Excel file. How do I use this data table object in an UPDATE query to update an existing SQL Server table? I encounter this error: Exception has been thrown by the…
Justin CR
  • 179
  • 11
3
votes
1 answer

SSIS Getting Exception When Accessing Int Variable

I am trying to create a script that will generate folders that I need on the fly. The script takes a FolderName and OrderID variable to generate the folder names to create. I Added them to the Read Only variables for the script. Everything works…
Dizzy49
  • 1,360
  • 24
  • 35
3
votes
2 answers

How to declare a Worksheet using a Script Task?

I'm trying to declare a Worksheet to handle cells of .xlsx file, but my C# script fails when I declare Worksheet object : Microsoft.Office.Interop.Excel.Application xlApp = new Microsoft.Office.Interop.Excel.Application(); Workbook excelBook =…
MedEc
  • 169
  • 1
  • 14
3
votes
1 answer

Code only converting last worksheet to csv

I wrote a program in C# that is supposed to convert each worksheet in my excel workbook to a csv and save it in their own files. The problem I'm having is that when I open each file, they all have the same content as the very last worksheet. Here is…
jim
  • 1,026
  • 2
  • 15
  • 37
3
votes
2 answers

SSIS ERROR "Conversion failed because the data value overflowed the specified type"

I'm using ssis to parse file txt into sql server. I use script task to convert a string example "20190523100520" (type :yyyy-MM-dd HH:mm:ss) to datetime (it's data type in table sql ). But I get the error: [OLE DB Destination [68]] Error: "There…
3
votes
2 answers

File extension Script task and Error handling

I've literally no experience in VB script or C#. I've created this SSIS package using some online tutorial which server my purpose but I've to fine-tune it to fit my requirements. Current Scenario: I'm trying to run an SSIS package which has a…
intruder
  • 417
  • 1
  • 3
  • 18
3
votes
1 answer

How do I find the right syntax for VB.Net in SSIS 2013 using Microsoft.Office.Interop.Excel?

I am using SSIS to load data from Excel 2013 to SQL Server 2014. One column has data that exceeds 255 char. Using the source Excel task will only read the first 255 char truncating the rest. I wrote a .vb script to open the file and save it as a…
rmj
  • 31
  • 2
3
votes
2 answers

Assembly redirect not working for SSIS script task

We've a requirement where some SSIS packages need to run on multiple SQL Server versions (2014 and 2016), without us having to maintain 2 versions of the code base. I've built a wrapper C# console app which has assembly redirects (listed below) in…
1 2
3
24 25