slugfest52
Programmer
I'm bringing data from a text file into a database table. I want to INSERT the new records and UPDATE any existing. The insertion works fine, but the update is not happening (no error, but the data is not updated). Is there anything wrong with this function?
Function Main()
' --- set up the columns to transform
DTSDestination("UID") = DTSSource("UID")
DTSDestination("Name") = DTSSource("Name")
If DTSLookups("UIDlookup").Execute(DTSSource("UID")) <> "" Then
' --- employee record exists, so update it
Main = DTSTransformstat_UpdateQuery
Else
' --- record doesn't exist, so insert it
Main = DTSTransformstat_InsertQuery
End If
End Function
Here's my Lookup:
SELECT UID
FROM TestData
WHERE (UID = ?)
Function Main()
' --- set up the columns to transform
DTSDestination("UID") = DTSSource("UID")
DTSDestination("Name") = DTSSource("Name")
If DTSLookups("UIDlookup").Execute(DTSSource("UID")) <> "" Then
' --- employee record exists, so update it
Main = DTSTransformstat_UpdateQuery
Else
' --- record doesn't exist, so insert it
Main = DTSTransformstat_InsertQuery
End If
End Function
Here's my Lookup:
SELECT UID
FROM TestData
WHERE (UID = ?)