How to resolve "variable 'x' can't be set to the value of 'null'" in sql?


SET @unknown_variable = NULL;
This message appears when you try to set a variable to NULL that doesn’t support NULL values.


-- Use a value other than NULL or ensure the variable can accept NULL values.

Beginner's Guide to SQL