Update table with data from another table by decreasing character

1

Hello, I have the BDMCOM1 bank that has a Product Balance table and a Quantity column with values like this: 1,000. However I have another bank BDMCOM1_V3_ALEA that also has the Product Balance table and Quantity column, but with values in this standard 1.00.

In the case I wanted to know how to update the values of the bank quantity BDMCOM1_V3_ALE with the values of the bank BDMCOM1 only by removing a character to stay in the correct pattern.

    
asked by anonymous 11.07.2016 / 16:08

1 answer

1

I did a test here:

declare @teste decimal(10, 3);
select @teste = 3.456;

select convert(decimal(10, 2), @teste);
-- Resultado: 3.46

If the source and destination fields are decimal and different precisions, simple value overwriting works, but with the loss of the last decimal place, with the rounding up, if the last house is between 5 and 9, and down if the last house is between 0 and 4.

    
11.07.2016 / 17:04