Hi guys,
I have a table as below:
SERVERNAME
STATUS
...where STATUS can be multiple values from another table (PRODUCTION, DEVELOPMENT and RETIRED)
So, I have this ASP.net page where I display 3 checkboxes (one per status) where the user can filter the list based on multiple values.
How would you implement this using a stored procedure?
I was thinking in passing a CSV parameter and using the IN clause, but T-SQL doesn't like it.
SET @list = 'production,development'
SELECT * FROM servers WHERE status IN (@list)
I found posts saying I need to convert the CSV into a table then link it to the IN clause, but I'd like to know from you guys...how would you implement it?
Thanks for the advice
...Alex
I have a table as below:
SERVERNAME
STATUS
...where STATUS can be multiple values from another table (PRODUCTION, DEVELOPMENT and RETIRED)
So, I have this ASP.net page where I display 3 checkboxes (one per status) where the user can filter the list based on multiple values.
How would you implement this using a stored procedure?
I was thinking in passing a CSV parameter and using the IN clause, but T-SQL doesn't like it.
SET @list = 'production,development'
SELECT * FROM servers WHERE status IN (@list)
I found posts saying I need to convert the CSV into a table then link it to the IN clause, but I'd like to know from you guys...how would you implement it?
Thanks for the advice
...Alex