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.
| Author |
Topic |
|
slugfest
Starting Member
18 Posts |
Posted - 2004-09-01 : 10:35:59
|
| 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. Is there anything wrong with this function?Function Main()' --- set up the columns to transformDTSDestination("UID") = DTSSource("UID")DTSDestination("Name") = DTSSource("Name")If DTSLookups("UIDlookup").Execute(DTSSource("UID")) <> "" Then' --- employee record exists, so update itMain = DTSTransformstat_UpdateQueryElse' --- record doesn't exist, so insert itMain = DTSTransformstat_InsertQueryEnd IfEnd FunctionHere's my Lookup:SELECT UIDFROM TestDataWHERE (UID = ?) |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2004-09-01 : 20:09:10
|
Don't you need to issue aMain = DTSTransformstat_OK to commit the changes? |
 |
|
|
slugfest
Starting Member
18 Posts |
Posted - 2004-09-02 : 12:35:06
|
| Not sure, Timmy.Where would that fall in the function? |
 |
|
|
|
|
|