T-SQL Tutorial

Msg 1002 Level 16 - Specified scale is invalid


On Transact SQL language the Msg 1002 Level 16 - Specified scale is invalid means that the scale value is greater than the maximum value.

Msg 1002 Level 16 Example:

Invalid select:

SELECT TIMEFROMPARTS ( 16, 13, 23, 7, 1 ) as 'Col 1',
TIMEFROMPARTS ( 14, 13, 23, 70, 2 ) as 'Col 2',
TIMEFROMPARTS ( 14, 13, 23, 700, 30 ) as 'Col 3';

Message
Msg 1002, Level 16, State 2, Line 1
Line 3: Specified scale 30 is invalid.

Correct select:

SELECT TIMEFROMPARTS ( 16, 13, 23, 7, 1 ) as 'Col 1',
TIMEFROMPARTS ( 14, 13, 23, 70, 2 ) as 'Col 2',
TIMEFROMPARTS ( 14, 13, 23, 700, 3 ) as 'Col 3';

Col 1Col 2Col 3
16:13:23.714:13:23.7014:13:23.700

Other error messages: