SELECT
t.blah
, t.blah2
FROM
tblBlah t
WHERE
exists (
select 1 where parm = 0
union all
SELECT 1 FROM tbl t2
where t.intCodes = t2.intCodes
)
Tim Curtin wrote:
> Hello folks,
>
> I'm trying to set the hard-coded values or the parm in a
IN operator
> without using dynamic SQL.
>
> I've tried a couple of different approaches. This most
recent one
> doesn't work
>
>
> declare tbl TABLE
> (
> intCodes INT
> )
>
> INSERT tbl select 123
> INSERT tbl select 456
> INSERT tbl select 789
>
> SELECT blah, blah
> FROM tblBlah
> WHERE intField IN ( CASE WHEN parm = 0 THEN
> (SELECT intCodes FROM
tbl)
> ELSE
> parm
> END)
--- List Settings ---
http://aspadvice.com/list
s/