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-08-31 : 13:00:49
|
| I am importing data from a text file and inserting/updating it in a database table. The package executes successfully, but the data does not update. Here are my pieces...Text Source------------UIDNameTestData Table---------------UIDNameLook up---------------SELECT UIDFROM TestDataWHERE (UID = ?)Insert Query---------------INSERT INTO TestData (UID, Name)VALUES (?, ?)Update Query---------------UPDATE TestDataSET OfficeName = ?WHERE (UID = ?)Transformation--------------- 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 |
|
|
|
|
|