SQL SERVER – Puzzle Involving NULL – Resolve – Error – Operand data type void type is invalid for sum operator
- by pinaldave
Today is Monday let us start this week with interesting puzzle. Yesterday I had also posted quick question here: SQL SERVER – T-SQL Scripts to Find Maximum between Two Numbers
Run following code:
SELECT SUM(data)
FROM (SELECT NULL AS DATA) t
It will throw following error.
Msg 8117, Level 16, State 1, Line 1
Operand data type void type is…