Hi i have a problem with my procedure
Stored-Procedure:
SELECT dbo.Table1.*,
CAST (CASE WHEN Table1.Id IS IN ( SELECT Id
FROM dbo.Table2
WHERE RefRolleId =@Id)
THEN 0 ELSE 1 END AS bit) AS selected
FROM dbo.Table1
ERROR:
wrong syntax near to IN-Keyword
wrong syntax near to THEN-Keyword
i googled around but i doesn’t found an example for an Case with an IN operator
could somebody please enlight me whats wrong
Any advice is greatly appreciated
just remove
ISand it will work (this is just to answer your question directly and nothing else (eg performance improvement))