I want to know whether the above piece of code works in checking if the variable is null or empty. Answer Yes, that code does exactly that. You can also use: Edit: With the added information that @value is an int value, you need instead: An int value can never contain the value ”.