Solved

SSIS Script Component

Posted on 2010-11-30
7
544 Views
Last Modified: 2013-11-10
Hello
I have been trying to get this VB.net code tp work, but I get the follwoing error.

[OLE DB Destination [205]] Error: There was an error with input column "bdat" (277) on input "OLE DB Destination Input" (218). The column status returned was: "The value could not be converted because of a potential loss of data.".

I have six dates that need to work, some will have Null values. I have tried everything I know. ethier If I get it to work it will not process all the way, giving thie error also. Buffer is full can not  load this column.


Here is my Code:

.For i As Integer = 0 To arr.Length - 1
                With Output0Buffer
                    .AddRow()
                    .pcontrol = Row.pcontrol
                    .Recordid = Row.recordid
                    .hnum = Row.hnum
                    .bdat = Row.bdat    - It will blow here
                    .adat = Row.adat
                    .prpd = Row.prpd
                    .ddat = Row.ddat
                    .stperiodf = Row.stperiodf
                    .stperiodt = Row.stperiodt

                    .zip = Row.zip
                    strSex = convtSex(Row.sex)
                    .sex = strSex
                    strLvdays = Row.lvdays.ToString.Trim

                    If strLvdays = "" Then
                        intlvday = 0
                        .lvdays = intlvday
                    Else
                        intlvday = CInt(strLvdays)
                        .lvdays = intlvday

                    End If

                    .race = Row.race.ToString()
                    .ethn = Row.ethn.ToString()
                    .adms = Row.adms.ToString()
                    .admt = Row.admt.ToString()
                    .pttype = Row.pttype.ToString()
                    .dxp = Row.dxp.ToString()
                    .dxa = Row.dxa.ToString()
                    .dxe1 = Row.dxe1.ToString()
                    .pina = Row.pina.ToString()
                    .pinb = Row.pinb.ToString()
                    .pinc = Row.pinc.ToString()
                    strprp = Row.prp.ToString()
                    If Len(Trim(strprp)) < 5 Then
                        .prpicd1 = strprp
                    Else
                        .prpcpt = strprp
                    End If
                    .prp = Row.prp
                    .prpmod1 = Row.prpmod1
                    .prpmod2 = Row.prpmod2
                    .prpmod3 = Row.prpmod3
                    .prpmod4 = Row.prpmod4
                    .ptstatus = Row.ptstatus
                    .sopid = Row.sopid
                    .soptype = Row.soptype
                    .provid = Row.provid
                    .tc = Row.tc
                    .billtype = Row.billtype
                    .mrn = Row.mrn
                    .ccode1 = Row.ccode1
                    .ccode2 = Row.ccode2
                    .ccode3 = Row.ccode3
                    .certnum = Row.certnum
                    .ecid = Row.ecid
                    .dxppoa = Row.DXPPOA
                    .DXRV1 = Row.DXRV1
                    .DXRV2 = Row.DXRV2
                    .DXRV3 = Row.DXRV3
                    '.quarteryear = strYr
                    '.quarternum = strQtr
                    ipControlCount += 1
                End With
            Next
0
Comment
Question by:DevoinIT
  • 4
  • 3
7 Comments
 
LVL 22

Expert Comment

by:8080_Diver
ID: 34239324
This looks a heck of a lot like a question you previously posted entitled "Derived column SSIS data conversion".

Reposting the same question is generally considered a violation of the rules of EE.
0
 

Author Comment

by:DevoinIT
ID: 34239374
Hello 808Driver

This was the first step I was trying to get to work, but it will have problems with dates and buffer column. I am using a Script Compnent transformation on this process.

They are simlar, but a different process. I would like to get both of them them to work.
0
 

Author Comment

by:DevoinIT
ID: 34239387
So far I have tried the Derived Column Transformation and the Script Component Transformation and the dates and null are having a problem.
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 22

Expert Comment

by:8080_Diver
ID: 34239428
That is part of why I tend to use staging tables.  In a SQL statement to accomplish the inserts, you can set up a CASE statement something like the attached to handle the NULL's.
CASE WHEN datecolumn1 IS NULL 

     THEN NULL

     ELSE CONVERT(DATEIMTE . . . ) 

END AS datecoumn1

Open in new window

0
 

Author Comment

by:DevoinIT
ID: 34239479
I will try this stagging area and let you know. Just to let you know this will process about 1 million records into a staging area then move the data into another Server. I will see how long this process will take.
0
 
LVL 22

Accepted Solution

by:
8080_Diver earned 250 total points
ID: 34239986
Using a staging table will possibly present other overall improvements because you won't be pulling nearly as much into memory before processing and moving to the other database/table.
0
 

Author Closing Comment

by:DevoinIT
ID: 34346063
I did not want to take this route but I did not havea choice in order to get the work Out. Thanks
0

Featured Post

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now