using script task
Hi.. i am validation on one column "Code" checking for the length of column.. I have declared IsGoodRecord column also. If (Row.Code.Length()) > 4 Then Row.IsGoodRecord = 3 ErrorDesc += "Warning : Length of code exceeds, Trucated value will be stored in table" End If How can i also store the truncated value in table. and when i running this i am getting this error at ScriptComponent_ee54526e838f4cf2b1e0d8e718961ee7.ScriptMain.Input_ProcessInputRow(InputBuffer Row) at ScriptComponent_ee54526e838f4cf2b1e0d8e718961ee7.UserComponent.Input_ProcessInput(InputBuffer Buffer) at ScriptComponent_ee54526e838f4cf2b1e0d8e718961ee7.UserComponent.ProcessInput(Int32 InputID, PipelineBuffer Buffer) at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer) Please help me
June 22nd, 2011 11:09am

To do the data validation I would use the Conditional Split Transformation component with a SSIS expression to redirect those rows that are not qualifying to a table. It is done similar to what this blog post shows: http://www.techrepublic.com/blog/datacenter/handle-conditional-data-and-data-conversion-using-sql-server-2005-integration-services/212Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
June 22nd, 2011 11:21am

I concur with Arthur - using a Script component here is "overkill". Use a Conditional Split instead. But to answer your question directly... it's difficult. Because you haven't provided the error report, just the stack trace. I can see a couple potential issues in your code. First, "Length" is not a method, it's a property - remove the parentheses. Second, what data type is "IsGoodRecord"? It had better be an integer type, not a boolean. Third, what is ErrorDesc, and what do you do with it? Talk to me now on
June 22nd, 2011 12:42pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics