I have a stored procedure called from the .aspx.cs page. I have a parameter that sometimes cannot be sent when sproc is called. Because of this, I do the following:
IF @variable is null BEGIN ...do this... END Else ...do that...
My problem is the IF statement. As far as I can tell, when I use any of the following actions:
if @parameterVariable = nullif @parameterVariable = ''if @parameterVariable <= 0
Nothing happens!? When I debug sproc in SSMS, I find this (although the parameter is empty (without user selection)), to which the cursor jumps and runs the code in the ELSE statement. Am I doing something wrong?
Thanks!
source share