Home > Archive > MS SQL Server DTS > July 2005 > MySQL varchar to SQL Server datetime when NULL









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MySQL varchar to SQL Server datetime when NULL
Manuel

2005-07-21, 7:23 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_t
able") = 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

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com