Consider the following example
declare @amount decimal(12,2)
select parsename(@amount,2) as precision, parsename(@amount,1) as scale
The result is
Parsename is used to extract specified part of a name. In general, it is used to extract names from four part object names separated by a dot. Argument number 1 extracts the last part of a string, and the 2nd argument extracts the next last part.
This way we can effectively make use of parsename function to extract precision and scale values from the decimal numbers.