![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi All, I get following error when I use DTS to copy data from DB2 to SQL server, DB2's field type is TIME and SQL Server's field type was automatically map with smalldatetime, but some tables that have same mapping don't have such problem. --------------------------- Copy Data from TIMES to [TEST].[dbo].[TIMES] Step --------------------------- Error during Transformation 'DirectCopyXform' for Row number 1. Errors encountered so far in this task: 1. TransformCopy 'DirectCopyXform' conversion error: General conversion failure on column pair 4 (source column 'DURATION' (DBTYPE_DBTIME), destination column 'DURATION' (DBTYPE_DBTIMESTAMP)). The SQL Server 200 has been installed SP3 Does anyone have any suggestions? Thanks in advance, Herbert |
#3
| |||
| |||
|
|
I do not know what are the boundaries of TIME on DB2 but it is my guess that they break the limitations of SMALLDATETIME in SQL Server. Hve a look at those restrictions for SQL Server here mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\tsq lref.chm::/ts_da-db_9xut.htm If the boundaries are the same then you are probably presenting the data to SQL Server in a format that it interprets incorrectly. -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Herbert Mo" <hnmo (AT) stryon (DOT) com> wrote in message news:OEXsfFfcDHA.1552 (AT) TK2MSFTNGP11 (DOT) phx.gbl... Hi All, I get following error when I use DTS to copy data from DB2 to SQL server, DB2's field type is TIME and SQL Server's field type was automatically map with smalldatetime, but some tables that have same mapping don't have such problem. --------------------------- Copy Data from TIMES to [TEST].[dbo].[TIMES] Step --------------------------- Error during Transformation 'DirectCopyXform' for Row number 1. Errors encountered so far in this task: 1. TransformCopy 'DirectCopyXform' conversion error: General conversion failure on column pair 4 (source column 'DURATION' (DBTYPE_DBTIME), destination column 'DURATION' (DBTYPE_DBTIMESTAMP)). The SQL Server 200 has been installed SP3 Does anyone have any suggestions? Thanks in advance, Herbert |
#4
| |||
| |||
|
|
Hi Allan, I got the error --------------------------- Copy Data from TIMES to [TEST].[dbo].[TIMES] Step failed Microsoft Data Transformation Services (DTS) Data Pump The number of failing rows exceeds the maximum specified. (Microsoft Data Transformation Services (DTS) Data Pump (80040e21): ActiveX Scripting Transform 'AxScriptXform' encountered an invalid data value for 'DURATION' source column.) --------------------------- Below are the piece of code, please help me figure it out, thanks a lot. --------------------------- Function Main() DTSDestination("INDEX") = DTSSource("INDEX") DTSDestination("DAY") = DTSSource("DAY") DTSDestination("START_TIME") = DTSSource("START_TIME") If LEFT(DURATION, 2) = "24" Then DTSDestination("DURATION") = "00:00:00" Else DTSDestination("DURATION") = DTSSource("DURATION") End If DTSDestination("CREATE_DATE") = DTSSource("CREATE_DATE") DTSDestination("MODIFY_DATE") = DTSSource("MODIFY_DATE") DTSDestination("MODIFY_USERID") = DTSSource("MODIFY_USERID") Main = DTSTransformStat_OK End Function --------------------------- "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:unAUR8qcDHA.4020 (AT) tk2msftngp13 (DOT) phx.gbl... You could simply return it to a string and do If (LEFT(col,2) = "24" then Destination = ..... 00:00:000 end if -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Herbert Mo" <hnmo (AT) stryon (DOT) com> wrote in message news:%23Lw8auqcDHA.356 (AT) TK2MSFTNGP11 (DOT) phx.gbl... Hi Allan, You are right, it is due to 24:00:00 cannot be known in SQL Server's smalldatetime, do you have a good idea to change it to 00:00:00? Thanks, Herbert "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:ulDbyKfcDHA.1884 (AT) TK2MSFTNGP10 (DOT) phx.gbl... I do not know what are the boundaries of TIME on DB2 but it is my guess that they break the limitations of SMALLDATETIME in SQL Server. Hve a look at those restrictions for SQL Server here mk:@MSITStore:C:\Program%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\tsq lref.chm::/ts_da-db_9xut.htm If the boundaries are the same then you are probably presenting the data to SQL Server in a format that it interprets incorrectly. -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Herbert Mo" <hnmo (AT) stryon (DOT) com> wrote in message news:OEXsfFfcDHA.1552 (AT) TK2MSFTNGP11 (DOT) phx.gbl... Hi All, I get following error when I use DTS to copy data from DB2 to SQL server, DB2's field type is TIME and SQL Server's field type was automatically map with smalldatetime, but some tables that have same mapping don't have such problem. --------------------------- Copy Data from TIMES to [TEST].[dbo].[TIMES] Step --------------------------- Error during Transformation 'DirectCopyXform' for Row number 1. Errors encountered so far in this task: 1. TransformCopy 'DirectCopyXform' conversion error: General conversion failure on column pair 4 (source column 'DURATION' (DBTYPE_DBTIME), destination column 'DURATION' (DBTYPE_DBTIMESTAMP)). The SQL Server 200 has been installed SP3 Does anyone have any suggestions? Thanks in advance, Herbert |
![]() |
| Thread Tools | |
| Display Modes | |
| |