Hi. I'm relatively new to SQL scripting. I've looked at various
reference books, but they are not very helpful. Thus, any
assistance/suggestions will be greatly appreciated!
I have a tab-delimited flat file that I need to BCP into a table
called FINAL. I cannot do a straight BCP of the flat file into the
FINAL table because the data file contains more fields than the FINAL
table. Also, the data in the flat file needs to be processed.
For example, adding field2 and field3 of the data file = field2 of the
Another example: If field5 in FINAL table = 0, then populate field6
of FINAL table with field7 of data file. Otherwise, populate field6
of FINAL table with field8 of data file.
What would the coding look like in the above examples?
I believe I will have to create a temp table that will store all the
fields in the data file. The temp table will have to have the same
number of fields in the flat file. Then, I would do the data
processing from this temp table. Would the results of the data
processing have to go into another temp table? Or could I do
something else? I guess this is the part where I'm struggling with.
Once again, any assistance/suggestions will be greatly appreciated!