vba - VB script into SQL (VB making 2 inserts into one column) -


i'm new coding pls take easy on me.
i'm rewriting visual basic sql.

the vb code inserts transformed data file tabley.
want sql code load data tablex, transform , load tabley.
created tablex , inserted untransformed data file. want transform , insert tabley when notice problem.

here vb code

if some-if-statement     dtsdestination("max") = mid(dtssource("col001"),985,5)     mid     mid     mid     dtsdestination("max") = mid(dtssource("col001"),983,5) 

here sql version:

insert tabley (max, aaa, bbb, ccc, max) select     substring(col001,985,5),     substring,     substring,     substring,     substring(col001,983,5) tablex  some-where-statement 

the problem i'm trying insert 2 values [substring(col001,985,5) , substring(col001,983,5)] 1 column.
sql gives me error:

the column name 'max' specified more once in set clause or column list of insert. column cannot assigned more 1 value in same clause. modify clause make sure column updated once. if statement updates or inserts columns view, column aliasing can conceal duplication in code.`

i vb version works, though shouldn't - because same thing.
ideas on how can fix this? inserting 1 value won't work me since don't know 1 correct one.

it turns out the vb script overwriting data. second insert 1 being inserted.


Comments

Popular posts from this blog

serialization - Convert Any type in scala to Array[Byte] and back -

matplotlib support failed in PyCharm on OSX -

python - Matplotlib: TypeError: 'AxesSubplot' object is not callable -