select newvalue,
newvalue.value('(/root//item//col[@name=''invoiceID''])[1]', 'uniqueidentifier') as invoiceID,
newvalue.value('(/root//item//col[@name=''correctInvoiceID''])[1]', 'uniqueidentifier') as correctInvoiceID,
newvalue.value('(/root//item//col[@name=''invoiceIssueDate''])[1]', 'smalldatetime') as invoiceIssueDate,
newvalue.value('(/root//item//col[@name=''invoiceCategory''])[1]', 'nvarchar(max)') as invoiceCategory,
newvalue.value('(/root//item//col[@name=''invoiceReceiveDate''])[1]', 'smalldatetime') as invoiceReceiveDate,
newvalue.value('(/root//item//col[@name=''warehouseID''])[1]', 'uniqueidentifier') as warehouseID,
newvalue.value('(/root//item//col[@name=''issuerID''])[1]', 'uniqueidentifier') as issuerID,
newvalue.value('(/root//item//col[@name=''invoiceMonth''])[1]', 'int') as invoiceMonth,
newvalue.value('(/root//item//col[@name=''payerID''])[1]', 'uniqueidentifier') as payerID,
newvalue.value('(/root//item//col[@name=''recipientID''])[1]', 'uniqueidentifier') as recipientID,
newvalue.value('(/root//item//col[@name=''paymentTypeID''])[1]', 'uniqueidentifier') as paymentTypeID,
newvalue.value('(/root//item//col[@name=''paymentTime''])[1]', 'int') as paymentTime,
newvalue.value('(/root//item//col[@name=''deliveryWayID''])[1]', 'uniqueidentifier') as deliveryWayID,
newvalue.value('(/root//item//col[@name=''paymentDate''])[1]', 'smalldatetime') as paymentDate,
newvalue.value('(/root//item//col[@name=''saleDate''])[1]', 'smalldatetime') as saleDate,
newvalue.value('(/root//item//col[@name=''currency''])[1]', 'varchar(10)') as currency,
newvalue.value('(/root//item//col[@name=''groupID''])[1]', 'uniqueidentifier') as groupID,
newvalue.value('(/root//item//col[@name=''bankAccount''])[1]', 'uniqueidentifier') as bankAccount,
newvalue.value('(/root//item//col[@name=''currencyExchangeRate''])[1]', 'decimal(18,4)') as currencyExchangeRate,
newvalue.value('(/root//item//col[@name=''currencyExchangeDate''])[1]', 'smalldatetime') as currencyExchangeDate,
newvalue.value('(/root//item//col[@name=''currencyExchangeTableNumber''])[1]', 'nvarchar(max)') as currencyExchangeTableNumber,
newvalue.value('(/root//item//col[@name=''remoteSource''])[1]', 'nvarchar(max)') as remoteSource,
newvalue.value('(/root//item//col[@name=''remoteID''])[1]', 'uniqueidentifier') as remoteID,
newvalue.value('(/root//item//col[@name=''summaryCalculationType''])[1]', 'int') as summaryCalculationType,
newvalue.value('(/root//item//col[@name=''invoiceMemo''])[1]', 'nvarchar(max)') as invoiceMemo,
newvalue.value('(/root//item//col[@name=''correctionBase''])[1]', 'nvarchar(max)') as correctionBase
from [log].[wall] where remoteid ='6D32BAE4-EC73-EC11-82E9-0690A1809DE2' and operation='insert'