DJMoonLight
asked on
DTS - Import file update/insert record
I am attemting to write a dts package that imports a file and if the record exists update the record and if it doesn't insert it.
I am using a data driven query..
Here is what i have:
Function Main()
Select case DTSSOurce("col001")
case (DTSSource("col001") = DTSDestination("numID") )
DTSDestination("numID") = DTSSource("Col001")
DTSDestination("txtName"). value = DTSSource("Col002").value
Main = DTSTransformstat_UpdateQue ry
case else
DTSDestination("numID") = DTSSOURCE("col001")
DTSDestination("txtName"). value = DTSSOurce("Col002").value
Main = DTSTransformstat_InsertQue ry
end select
End Function
I am getting cannot insert duplicate records..
Do you see anything i am doing wrong?
thanks
I am using a data driven query..
Here is what i have:
Function Main()
Select case DTSSOurce("col001")
case (DTSSource("col001") = DTSDestination("numID") )
DTSDestination("numID") = DTSSource("Col001")
DTSDestination("txtName").
Main = DTSTransformstat_UpdateQue
case else
DTSDestination("numID") = DTSSOURCE("col001")
DTSDestination("txtName").
Main = DTSTransformstat_InsertQue
end select
End Function
I am getting cannot insert duplicate records..
Do you see anything i am doing wrong?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
well, even if one can/could, it's not recommendable, as it would check line by line. takes too much time