An expression of non-boolean type specified in a context where a condition is expected, near 'END'.
Posted
by Mike Keller
on Stack Overflow
See other posts from Stack Overflow
or by Mike Keller
Published on 2010-06-10T21:11:01Z
Indexed on
2010/06/10
21:12 UTC
Read the original article
Hit count: 491
sql
|sql-server-2005
So maybe someone can point me in the right direction of what is causing this error? I've been fighting with this for a couple of hours and searching the web, and I can't figure out what I'm doing wrong here. It's included as part of a stored procedure, I don't know if that matters, if it does I can include that as well. Tables and field names have been changed to protect the innocent... meaning my job. Thanks.
SELECT
/* The fields are here*/
FROM
/* my joins are here */
WHERE
(Table.Field = stuff)
AND
(Table.Field2 = otherstuff)
AND
(Table2.Field3 = someotherstuff)
AND
CASE @param1
WHEN 0 THEN 'Table.Field IS NULL'
WHEN 1 THEN 'Table.Field2 IS NOT NULL'
ELSE ''
END
© Stack Overflow or respective owner