User Profile
Collapse
-
It worked like a charm.... Thank You so much.. -
Sorry that was typo, i have added else but the code suggested also did not work for me...
may be i was not clear in description ... i have changed the query little (below)...
what i need is if parameter value is 0(ZERO) then all records should display and if the parameter value is passed as (multiple ID's) then it should display only the selected records...
Please suggest...
...Code:DECLARE @STRID
Leave a comment:
-
WHERE clause with IN clause with CASE WHEN...
I am trying to use below code and it does not work... but cant live without below conditions... is there any otherway anyone knows to do the same thing?
if i pass 0 in STRID then it should show me ALL records but if i pass 1,2,5 then it should show me only records which has 1,2,5 ID's in tble.
Thanks in Advance..
DECLARE @STRID AS VARCHAR(MAX)
--SET @STRID = '1,2,3'
SET @STRID = NULL
...
No activity results to display
Show More
Leave a comment: