dbTalk Databases Forums  

TransformCopy 'DirectCopyXform' conversion error:

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss TransformCopy 'DirectCopyXform' conversion error: in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Herbert Mo
 
Posts: n/a

Default TransformCopy 'DirectCopyXform' conversion error: - 09-03-2003 , 02:59 AM






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



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: TransformCopy 'DirectCopyXform' conversion error: - 09-03-2003 , 03:09 AM






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

Quote:
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





Reply With Quote
  #3  
Old   
Herbert Mo
 
Posts: n/a

Default Re: TransformCopy 'DirectCopyXform' conversion error: - 09-04-2003 , 01:12 AM



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

Quote:
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







Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: TransformCopy 'DirectCopyXform' conversion error: - 09-04-2003 , 02:43 AM



If LEFT(DURATION, 2) = "24" Then
DTSDestination("DURATION") = "00:00:00"
Else
DTSDestination("DURATION") = DTSSource("DURATION")
End If


In your left function you have not said DTSSource("Duration")
Also you will need to reconstruct the string so say it looks like this

12/12/2003 24:00:00

You need to rebuild it into

12/12/2003 00:00:00

Also have a look at

Formatting Character Data into Datetime fields
(http://www.sqldts.com/default.aspx?249)



remember SQL Server if you do not specify a time will sub in midnight for
you.

--

----------------------------
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

Quote:
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













Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.