April 10, 2003 at 10:56 am
I am importing data from a comma dilimited file in to an "employee" table. All employee numbers begin with 0. I want to import the employee number and convert the 0 to the letter X. Is this a two step Process? Help thanks.
April 10, 2003 at 11:12 am
You can do it in many ways.
Just import the data to the table and exec the Update stmt to chage the employee number on the table.If it is a Pk on that table, then you can't update.
If itz PK for that table,then tranfer into the temp table and update the value and transfer the data from temp table to Employee tbl.
Edited by - spdhiva on 04/10/2003 11:12:34 AM
April 10, 2003 at 11:56 am
Is it possible to do it with out dumping into a temp table? Yes it is the PK for the target table.
April 10, 2003 at 12:36 pm
We can do it thro' active x scripts
--First You have to open the text file and change the filed on the text file.
--Transfer the data from changed text file to tbl.
I don't know whether you want to right the VB scripts for this.
The best method,Just create and drop the temp table and do the data validation.Itz all in background.
April 11, 2003 at 3:49 pm
April 12, 2003 at 11:14 am
I got this to work by using a transform VB Script function. Click on the transform button in the DTS import wizard and use the following script. Replace x with the lenth of your employee number.
'**********************************************************************
' Visual Basic Transformation Script
'************************************************************************
' Copy each source column to the destination column
Function Main()
s = "X" & Right( Cstr(DTSSource("EmplIdInFile")), x)
DTSDestination("TableEmplId") = s
Main = DTSTransformStat_OK
End Function
Darren
Darren
April 23, 2003 at 11:11 am
The script did exactly what I needed it to do. Thanks from a Newbie!
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply