Добро пожаловать в переполнение стека. Это должно быть довольно просто. Во-первых, давайте сгенерируем 50К строк образцов данных.
IF OBJECT_ID('tempdb..#things') IS NOT NULL DROP TABLE #things;
DECLARE @xml XML =
'<BillingTransactionInfo xmlns="http://xed.com/bc/gx.billsactioninfomodel">
<AccountingDate>2018-12-07T13:40:44</AccountingDate>
<AccountingDay>7</AccountingDay>
<AccountingMonth>12</AccountingMonth>
<AccountingYear>2018</AccountingYear>
<AccountNumber>PC:0049207</AccountNumber>
<AccountType>insured</AccountType>
<BillingReferenceNumber>50000018100</BillingReferenceNumber>
<CustomerName>JOHN MCGEE</CustomerName>
<GLMonth>12</GLMonth>
<GLYear>2018</GLYear>
<TransactionSubtypeCode>DirectBillMoneyReceivedTxn</TransactionSubtypeCode>
<TransactionSubtypeDesc>Direct Bill Money Received</TransactionSubtypeDesc>
<IssueDate>2018-12-07T13:40:37</IssueDate>
<PaymentMethod>cash</PaymentMethod>
<PolicyRiskState>AL</PolicyRiskState>
<ReasonCode>Direct Bill Money Received</ReasonCode>
<RecordCreationDate>2018-12-07T13:40:37</RecordCreationDate>
<Source>BILLING</Source>
<TransactionAmount>2570.77</TransactionAmount>
<TransactionCreateDate>2018-12-07T13:40:37</TransactionCreateDate>
</BillingTransactionInfo>';
SELECT TOP (50000)
id = IDENTITY(INT,1,1),
X = CAST(REPLACE(CAST(@xml AS VARCHAR(8000)),
'<TransactionAmount>2570.77</TransactionAmount>',
CONCAT('<TransactionAmount>',ABS(CHECKSUM(NEWID())%2250000)*.01,'</TransactionAmount>')) AS XML)
INTO #things
FROM sys.all_columns a, sys.all_columns b;
Решение:
SELECT id, tr.amt
FROM #things AS t
CROSS APPLY (VALUES(t.X.value(
'(/*:BillingTransactionInfo/*:TransactionAmount/text())[1]','DECIMAL(10,2)'))) AS tr(amt)
WHERE tr.amt > 15000;
Возвращает:
id amt
----------- ------------
201 21876.97
202 21229.64
204 19188.62
209 21680.17
212 18603.47
213 20507.21
216 19536.31
218 19490.95
...
Обновлено, чтобы продемонстрировать, как изменить значения до 10000 согласно запросу OP.
UPDATE t
SET X.modify('
replace value of (/*:BillingTransactionInfo/*:TransactionAmount/text())[1]
with "10000"')
FROM #things AS t
CROSS APPLY (VALUES(t.X.value(
'(/*:BillingTransactionInfo/*:TransactionAmount/text())[1]','DECIMAL(10,2)'))) AS tr(amt)
WHERE tr.amt > 15000;