Hi All,
Given a spreadsheet with two columns which will be imported into a table with multiple fields, and the need to increment the primary key for each insertion, what am I missing in this DTS?
Transformation script:
' Copy each source column to the destination column
Function Main()
DTSDestination("TrunkGroupID") = DTSLookups("getNextTGID").Execute
DTSDestination("TrunkGroupName") = DTSSource("TG")
DTSDestination("fyiBridgeName") = DTSSource("BRIDGE")
DTSDestination("BridgeID") = 0
DTSDestination("StatusFlag") = "Active"
Main = DTSTransformStat_OK
End Function
The Lookup query:
SELECT ISNULL(MAX(TrunkGroupID), 0) + 1 AS Expr1
FROM gcTrunkGroup
The error is on attempting to add a duplicate primary key. My DBA has suggested that, rather than committing the insert of each row right away, a group of inserts is being batched which results in the error. I have been unable to find where I would tell the DTS to commit each insert as it happens.
Thoughts?
TIA!
Marshall