Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup with DTS & VB Script

Status
Not open for further replies.

DaveRolph

Programmer
Sep 12, 2001
26
GB
Following on from a previous post( )

This is my first experience using VBS with DTS, I have the following Scipt within my DTS Package.


Dim tSeq
Dim tCleanSeq

Function Main()
tSeq = tSeq + 1
tCleanSeq = Right("0000000" & tSeq, 8)
DTSDestination("Patient_Number") = DTSSource("User.Ref")
DTSDestination("Details") = DTSSource("NOTE-DESC")
DTSDestination("Entered_By") = DTSSource("GN-AUTHOR")
DTSDestination("Entered_Date") = DTSSource("GN-DATE")
DTSDestination("Gen_Notes_ID") = tCleanSeq
DTSDestination("From_DB") = 3
Main = DTSTransformStat_OK
End Function



I then have a TSQL Script to update a column (one of those in the destination table), I am sure this could be done within the script rather than at the end of the import.

But I have no idea how, any idea's ?

Thanks

BTW This is the TSQL Update Script...

Update GENERAL_NOTES Set GENERAL_NOTES.Patient_Number = PATIENT_NUMBERS.Patient_Number,GENERAL_NOTES.Patient_No_Full= PATIENT_NUMBERS.Centre_Code+PATIENT_NUMBERS.Patient_Number
FROM GENERAL_NOTES INNER JOIN PATIENT_NUMBERS ON GENERAL_NOTES.Patient_Number = PATIENT_NUMBERS.Old_Code

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top