Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Conversion erro

Author  Topic 

Rajeshrrk
Starting Member

3 Posts

Posted - 2008-10-21 : 14:20:46
Hi,
I have Script that load one tabel from the other
' Copy each source column to the destination column
Function Main()
DTSDestination("Failure_Error_Type_ID") = DTSSource("Temp_Error_Type_ID")
DTSDestination("Failure_Transaction_ID") = DTSSource("Temp_Transaction_ID")
DTSDestination("Failure_Purchasing_System_ID") = DTSSource("Temp_Purchasing_System_ID")
DTSDestination("Failure_Electronic_Issue_ID") = DTSSource("Temp_Electronic_Issue_ID")
DTSDestination("Failure_Buyer_Assignment_ID") = DTSSource("Temp_Buyer_Assignment_ID")
DTSDestination("Failure_Duns_ID") = DTSSource("Temp_Duns_ID")
DTSDestination("Failure_Duns_Company_Assignment_ID") = DTSSource("Temp_Duns_Company_Assignment_ID")
DTSDestination("Failure_PO_Create_Date") = Replace( convert(varchar(11),DTSSource("po_create_date") ) )
DTSDestination("Failure_Item_Id") = DTSSource("item_id")
DTSDestination("Failure_PO_Line") = DTSSource("po_line")
DTSDestination("Failure_PO_Number") = DTSSource("po_number")
DTSDestination("Failure_Duns_Code") = DTSSource("duns_code")
DTSDestination("Failure_Duns_Company_Name") = DTSSource("vendor_name")
DTSDestination("Failure_Transaction_Date") = Replace( convert(varchar(11),DTSSource("transaction_date") ) )
DTSDestination("Failure_Date_Received") = Replace(convert(varchar(25),DTSSource("date_received") ) )
DTSDestination("Failure_Original_Value") = DTSSource("original_value")
DTSDestination("Failure_Error_Field_Value") = DTSSource("error_field_value")
Main = DTSTransformStat_OK
End Function


Get this error
Error during Transformation '<DTS Testing Transformation>' for Row number 1. Errors encountered so far in this task: 1.

Error Source: Microsoft Data Transformation Services (DTS) Data Pump
Error Description:Error Code: 0
Error Source= Microsoft VBScript runtime error
Error Description: Type mismatch: 'varchar'

Error on Line 13

Can some one Help?

Thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2008-10-22 : 12:50:58
I fear that VBScript is not able to understand T-SQL code.
Don't know but maybe this link will give a little help:
(look for: Transforming Date Data)
http://technet.microsoft.com/en-us/library/aa933459(SQL.80).aspx

Webfred

No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-22 : 13:00:21
try using derived column transformations for performing replace() functionality and then map newly created derived columns to destination columns.
Go to Top of Page
   

- Advertisement -