Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The specified condition is not a valid Transact-SQL expression

I'm attempting to set a conditional breakpoint in Microsoft SQL Server 2012.

The condition is simple: @RCICID IS NOT NULL. I'm pretty certain this is a valid expression. I've also tried @RCICID != '', which has the same result:

breakpoint error

How could I possibly make the condition more valid? Is there some other possible explanation for this error?

like image 751
Jimmy Avatar asked Nov 10 '22 19:11

Jimmy


1 Answers

A NULL value is invalid when evaluated in an SSMS 2012 breakpoint condition (so using ISNULL() doesn't help).

Declare a test variable and set the variable to a non-null value, then set the breakpoint on the value of the test variable.

...
DECLARE @Null_RCICID integer;

SET @Null_RCICID = CASE WHEN @RCICID IS NULL THEN 1 ELSE 0 END;
...

The set the breakpoint condition @Null_RCICID=1

like image 180
grahamj42 Avatar answered Nov 29 '22 03:11

grahamj42