I have a XML in the format below with fields company and account etc, which would be the source schema
<Root xmlns="http://schema.Balance_SourceSchema">
<Balance xmlns="">
<Company>"PKG"</Company>
<Account>"1010.10.10"</Account>
<Type>"P&L"</Type>
<Description>"FREIGHT REVENUE"</Description>
<Units>""</Units>
<Branch>"HKC"</Branch>
<Department>"BIL"</Department>
<Activity>"Forwarding"</Activity>
<Direction>"Export"</Direction>
<Mode>"Sea"</Mode>
<Year>"2023"</Year>
<Period>"202305"</Period>
<AmountInPeriod>"-31,844.20</AmountInPeriod>
<Currency>"HAKD"</Currency>
</Balance> ...
And the table should have the same fields + ID, Created Date added to it.
1条答案
按热度按时间t3psigkw1#
Please try the following as a starting point for your stored procedure.
You may need to adjust a couple of things:
.value()
method 2nd parameter data types to match your target table.TRIM()
function.SQL