SQL_VARIANT_PROPERTY is close
DECLARE @what sql_variant;
DECLARE @foo decimal(19,3) = 1, @bar decimal(11,7) = 2;
SELECT @what = @foo / @bar;
SELECT
SQL_VARIANT_PROPERTY(@what, 'BaseType'),
SQL_VARIANT_PROPERTY(@what, 'Precision'),
SQL_VARIANT_PROPERTY(@what, 'Scale'),
SQL_VARIANT_PROPERTY(@what, 'MaxLength');
SELECT @what = @foo + @bar;
SELECT
SQL_VARIANT_PROPERTY(@what, 'BaseType'),
SQL_VARIANT_PROPERTY(@what, 'Precision'),
SQL_VARIANT_PROPERTY(@what, 'Scale'),
SQL_VARIANT_PROPERTY(@what, 'MaxLength');
SELECT @what = @foo * @bar;
SELECT
SQL_VARIANT_PROPERTY(@what, 'BaseType'),
SQL_VARIANT_PROPERTY(@what, 'Precision'),
SQL_VARIANT_PROPERTY(@what, 'Scale'),
SQL_VARIANT_PROPERTY(@what, 'MaxLength');
Or temp table/SELECT..INTO.. as an extension of what you've already done
Edit: Remus' answer?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…