Have a look at examples.
Below query:
SELECT A*B AS C
FROM (
SELECT '123' AS A, '2' AS B
) AS T
raises error:
Msg 8117, Level 16, State 1, Line 2
Operand data type varchar is invalid for multiply operator.
Why? Because of varchar data type. In this case numbers are stored as a text!!!
This query:
SELECT CONVERT(INT,A)*CONVERT(INT,B) AS C
FROM (
SELECT '123' AS A, '2' AS B
) AS T
returns:
246
Conclusion: Use appropriate
data types[
^]!