MySQL varchar to SQL Server datetime when NULL -
07-21-2005
, 05:46 AM
I use this script to convert a MySQL varchar to a SQL Server datetime
Function Main()
data_source = DTSSource("field_name_in_mysql_table")
If (IsEmpty(data_source) Or IsNull(data_source)) Then
data_destination = Null
Else
data = data_source
data_splitted = Split(data,"-")
data_destination = data_splitted(2) & "/" & data_splitted(1) & "/" &
data_splitted(0)
End If
DTSDestination("field_name_in_SQLS_table") = data_destination
Main = DTSTransformStat_OK
End Function
All is good while there is at least one varchar NOT NULL in MySQL
table, BUT
if all the value in DTSSource("field_name_in_mysql_table") are NULL i
get an error of "Conversion not supported";
Where is my mistake?
Thank you |