script-component

Getting column name from PipelineBuffer in Script Component in SSIS 2012

佐手、 提交于 2019-12-31 03:59:08
问题 I'm trying to get the column name and index from the PipelineBuffer in my script component transformation is SSIS and add them to a Hashtable. I know this is possible if I change my class from: public class ScriptMain : UserComponent to ScriptMain : PipelineComponent and use this code: public override void ProcessInput(int InputID, Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer Buffer) { inputBuffer = Buffer; hash = new Hashtable(); IDTSInput100 i = ComponentMetaData.InputCollection

Consuming Web Service in SSIS gives 'Mismatch between the processor architecture'

跟風遠走 提交于 2019-12-24 03:52:42
问题 I tried the tutorial below to consume a web service in a Script Component in SSIS. --Link to tutorial-- After pre-compiling I get following warning: Warning 1 There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Microsoft.SqlServer.DTSRuntimeWrap, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted

SSIS Script Component to remove '\0' charachers in CHAR(n) fields

坚强是说给别人听的谎言 提交于 2019-12-24 03:25:33
问题 I'm currently working on a database that have '\0' characters in fields. For instance the field Category CHAR(4) sometimes has value '\0\0\0\0' (4 zero characters) and sometimes ' ' (4 blank characters) I want to use a script component to individuate all the fields with this problem. I've written the following script, but it doesn't work since the C# converts the '\0\0\0\0' to an empty string. public override void Input0_ProcessInputRow(Input0Buffer Row) { Type rowType = Row.GetType();

Reading object variable values in SSIS script component source

喜欢而已 提交于 2019-12-23 06:29:22
问题 Is it possible to read object variable values in SSIS script component source? I have a variable, of type Object, which contains records from table populated by using a SQL Script Task. I have used this Script Task and it's working perfectly by using below code oleDA.Fill(dt, Dts.Variables("vTableRowsObj").Value) in this way where vTableRowsObj is object variable . I want to read this object in an SSIS script component so that I can directly give the output from script component to the

It's possible to use OleDbConnections with the Script Component?

我们两清 提交于 2019-12-21 12:22:04
问题 I'm building an ssis package and I wish to use an existing OleDbConnection inside the Script Component. Here is my code: public override void AcquireConnections(object Transaction) { base.AcquireConnections(Transaction); cm = this.Connections.Connection; con = (OleDbConnection)cm.AcquireConnection(Transaction); MessageBox.Show(con.ToString()); } When I close BIDS, i get the following message: "System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to class type

Does variable value set by Row Count Transformation take effect during execution of DFT in SSIS? or Conditional Split can read a variable correctly?

拈花ヽ惹草 提交于 2019-12-12 16:42:20
问题 I have a SSIS package where1 record (hard coded) flow through. I have variable in DFT scope. I assign value to variable using Row Count Transaformation. The value should be 1 i verify it by using script component. public override void PostExecute() { System.Windows.Forms.MessageBox.Show(ReadWriteVariables[0].Value.ToString()); base.PostExecute(); /* Add your code here for postprocessing or remove if not needed You can set read/write variables here, for example: Variables.MyIntVar = 100 */ } I

SSIS Script Component stripping underscores from column names

和自甴很熟 提交于 2019-12-11 06:05:33
问题 SSIS Script component strip's under scores from columnnames. Example : ColumnName : Customer_ID in Script components it looks as public override void SourceIn_ProcessInputRow(SourceInBuffer Row) { Row.CustomerID } How can i get Column Name with underscore, as I have to pass column name to other .dll which does error logging and needs correct column name. 回答1: I came across the same problem this morning, I didn't really need the underscores so accepted it after a little complaining. Perhaps

How to manage SSIS script component output columns and its properties programmatically

走远了吗. 提交于 2019-12-04 04:23:45
问题 I am developing a source in SSIS VS 2017 which calls REST API using script Component and serialises JSON and provides records which I am storing in SQL Table. While designing I need add output columns which are 200+ manually and set properties like data type and length manually for each and every column which is very tedious. Can any please suggest how can I add all those columns using a program and set properties using code or may be I just create one excel and just import it and it’s done

How to create an Asynchronous Script Component in SSIS?

眉间皱痕 提交于 2019-12-02 08:53:41
问题 I might be blind, but I don't see how to CREATE the script component. I'm not asking why do an asynchronous, how to work with it, etc. I just want to know how to add it to my package, or how to transform an already existing component into an asynchronous one! I'm using VS2008 with MSSQL 2008 R2. 回答1: I found how : Go in the Script Transformation Editor Select "Inputs and Outputs" from the leftmost part of the screen. Select your Output. Set "SynchronousInputID" to "None". Thanks to this site.

How to create an Asynchronous Script Component in SSIS?

微笑、不失礼 提交于 2019-12-02 03:37:33
I might be blind, but I don't see how to CREATE the script component. I'm not asking why do an asynchronous, how to work with it, etc. I just want to know how to add it to my package, or how to transform an already existing component into an asynchronous one! I'm using VS2008 with MSSQL 2008 R2. I found how : Go in the Script Transformation Editor Select "Inputs and Outputs" from the leftmost part of the screen. Select your Output. Set "SynchronousInputID" to "None". Thanks to this site . Creating an Asynchronous Transformation with the Script Component First bullet point under "Configuring