Puoi farlo seguendo:
DOMANDA
SELECT Amount,
CASE WHEN FLOOR(Amount) <> CEILING(Amount) THEN LEN(CONVERT(INT,CONVERT(FLOAT,REVERSE(CONVERT(VARCHAR(50), Amount, 128))))) ELSE 0 END AS Result
FROM YourTable
USCITA
Amount Result
123 0
123,1 1
123,0123 4
123,789456 6