title: How to debug script being a part of SSIS project?
body: <p>I have two databases. Source database:
  <a href="http://sdrv.ms/VkX8tj" rel="nofollow">http://sdrv.ms/VkX8tj</a></p>
  
  <p>and star database:
  <a href="http://sdrv.ms/12S7Zkc" rel="nofollow">http://sdrv.ms/12S7Zkc</a></p>
  
  <p>I'm transfering data from the 1st to the 2nd, using SSIS project:
  sdrv.ms/YDUvU4</p>
  
  <p>(can't post 3rd link, sorry for inconvenience)</p>
  
  <p>As You can see, there is an error in my script. It goes "The column has a null value." or to be exact (by a popping window):</p>
  
  <blockquote>
    <p>at Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.CheckStatusAndNull(Int32 columnIndex)
       at Microsoft.SqlServer.Dts.Pipeline.PipelineBuffer.GetDecimal(Int32 columnIndex)
       at ScriptMain.Input0_ProcessInputRow(Input0Buffer Row)
       at UserComponent.Input0_ProcessInput(Input0Buffer Buffer)
       at Microsoft.SqlServer.Dts.Pipeline.ScriptComponent.ProcessInput(Int32 InputID, PipelineBuffer buffer)
       at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)</p>
  </blockquote>
  
  <p>and (by the output of debugger):</p>
  
  <blockquote>
    <p>Error: 0xC0047062 at Data Flow Task, Script Component [337]: Microsoft.SqlServer.Dts.Pipeline.ColumnIsNullException: The column has a null value.
       at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)
       at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)
       at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper100 wrapper, Int32 inputID, IDTSBuffer100 pDTSBuffer, IntPtr bufferWirePacket)
    Error: 0xC0047022 at Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED.  The ProcessInput method on component "Script Component" (337) failed with error code 0x80131600 while processing input "Input 0" (347). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.  There may be error messages posted before this with more information about the failure.</p>
  </blockquote>
  
  <p>My script is exactly as templated except of filling out this one function:</p>
  
  <pre><code>public override void Input0_ProcessInputRow(Input0Buffer Row)
  {
      decimal WorkerWage = Row.Amount * Row.HourWage * Row.ProductionHours;
      Row.WorkerWage = WorkerWage;
  
      decimal TotalProductionCost = Row.Amount * Row.ProductionHours * (Row.ProductionCost + Row.HourCost) + WorkerWage;
      Row.TotalProductionCost = TotalProductionCost;
  
      decimal StandardPrice = TotalProductionCost * (1 + Row.Profit/100);
      Row.StandardPrice = StandardPrice;
  
      decimal TotalDiscount = StandardPrice * (Row.Discount / 100);
      Row.TotalDiscount = TotalDiscount;
  
      decimal TotalPrice = StandardPrice - TotalDiscount;
      Row.TotalPrice = TotalPrice;
  
      decimal TotalShippingCost = Row.ShippingCost + TotalPrice * (Row.ShippingTax / 100);
      Row.TotalShippingCost = TotalShippingCost;
  
      decimal RealProfit = TotalPrice - TotalProductionCost;
      Row.RealProfit = RealProfit;
  
      decimal TraderMargin = RealProfit * (Row.ProfitMargin / 100);
      Row.TraderMargin = TraderMargin;
  }
  </code></pre>
  
  <p>"The column has a null value" means something but is it input column or output one and which one exactly? How to figure that out?</p>
  
  <p>By the way, please, don't pay attention to content-based value of this project as it's done (well, will be done, I hope) only in educational purposes.</p>