script-task

SSIS package fails on file.delete of script task

只谈情不闲聊 提交于 2020-01-05 04:15:11
问题 I have an SSIS package , zip.dtsx. This package successfully runs on serverA. I copied this package in serverB. However, when I try to run zip.dtsx on serverB, it fails. zip.dtsx just reads a file in a source folder, compresses it, saves the compressed file to a different folder, then deletes the original file in the source folder. After some investigation, I figured out that if I comment out the part in the C# script task that deletes the file in the source folder. The package runs

“Runtime error Exception has been thrown by the target of an invocation” from Script task

夙愿已清 提交于 2019-12-28 06:46:26
问题 I have a SSIS package with a script task, I get the following error when i try to run it in my local system. It works fine for my collegues as well as in production. However, I am not able to run it locally, to test. I keep a debug point in the main method, but it is never reached, I get the error before it goes to main method. I am using VS 2010, .Net framework 4.5. The script task does compile. I get the following messages SSIS package "..\Test.dtsx" starting. Error: 0x1 at Test: Exception

SSIS package - Script task does not get executed when triggered through SQL Job Agent

為{幸葍}努か 提交于 2019-12-23 22:32:54
问题 I have an SSIS package that creates 2 text files using a data flow component. It connects to an SQL database and if the query returns data, the 2 files are created. After that, a script task loops through the folder where the 2 files are written into, determines the oldest file and moves it to another folder. Everything moves smoothly when I execute the package on the server. No errors and all functions are executed. Perfect. However, when I schedule the SSIS package in a job, the said script

Connect to SQL database inside Script Task in SSIS

心已入冬 提交于 2019-12-18 11:26:02
问题 Inside of a Script Task in SSIS, I need to make a call to an SQL database. I have a connection string that was created when I added the database to the data sources folder, however now I'm not sure how to reference it inside the C# code. I know how to do this in the code behind of an ASP website, however it seems that SSIS should have a more direct method. EDIT This line of code actually winds up throwing an exception: sqlConn = (System.Data.SqlClient.SqlConnection)cm.AcquireConnection(Dts

OutOfMemoryException while trying to read big Excel file into DataTable

北慕城南 提交于 2019-12-14 03:56:38
问题 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 in my data spreadsheet). For that I compare each column name from my first spreadsheet ( Error_Sheet ) with rows of a column that I added in a second spreadsheet and do the same for rows, and if I have the same value of cells I get back the column

How to configure the alfresco to run a script-task

五迷三道 提交于 2019-12-13 05:29:59
问题 I am trying to run a script task in alfresco process services, while compiling the script there were some error throw out in the console as like: the console couldn't run 'javascript' var x=5; var y=5; var xy=x*y; document.write("The result is"+xy); I expect the result as 25 that could be print in the console after the compilation of the script. Can anyone help me to resolve the issue? 回答1: Where/how are you running that code? Do you have a concrete error? Most probably the "document" gets

newtonsoft json package requires reinstall every time i open code

房东的猫 提交于 2019-12-12 19:07:03
问题 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 re-install the package using update-package -Reinstall as per the Some NuGet packages are missing from the solution in Visual Studio Application post. Why do I have to do this every time? Am I doing something wrong? Thanks for your help. 回答1: I found

How to declare a Worksheet using a Script Task?

非 Y 不嫁゛ 提交于 2019-12-12 13:33:28
问题 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 = xlApp.Workbooks.Open(fileFullPath); MySheet = (Excel.Worksheet)excelBook.Worksheets[Data_Sheet]; I've tried all of this statements : MySheet workSheet = (Worksheet)excelBook.Application.Sheets[1]; MySheet = (Excel.Worksheet)excelBook.Worksheets[1]; Even

How to pass a List of custom objects in a SSIS Script Task?

主宰稳场 提交于 2019-12-12 09:55:50
问题 I have a Script Task that creates a list of custom objects and sets them to an SSIS object variable. Custom class: public class Dog { public string Name { get; set; } } Code to populate the List and set to an SSIS object variable "myDogs": public void Main() { List<Dog> dogs = new List<Dog>(); Dog dog1 = new Dog(); dog1.Name = "Fido"; Dog dog2 = new Dog(); dog1.Name = "Roofus"; dogs.Add(dog1); dogs.Add(dog2); Dts.Variables["myDogs"].Value = dogs; } In a second Script Task, I am trying to read

Runtime error in script task

时光怂恿深爱的人放手 提交于 2019-12-12 02:45:26
问题 We have a fully running database server, say serverA , whose data are refreshed daily. We want to duplicate this database on a different server , says serverB , so that we have a test environment. The databases has been restored to serverB. Like serverA, we want serverB's data to be refreshed daily also, so the tests we conduct on serverB can be said as fully accurate since they will have the same data as serverA. We deployed the SSIS packages used in serverA in serverB and copied the SQL