This should be basic – but it driving me nuts on how to do it so any help would be much appreciated.
I have a column that contains [eventType] as follows
HAIL
TORNADO
FUNNEL
DOWNBURST
I want to pass to the Proc parameters to filter on [eventType] depending on weather check boxes on the web page are selected.
EXEC MyProc @_hail =1, @_tornado =1, @_ funnel=0, @ _downburt=0
MyProc
@_hail BIT,
@_tornado BIT,
@_ funnel BIT,
@ _downburt BIT
SELECT * from eventsTable
WHERE [eventType] = HAIL
OR [eventType] = TORNADO
I am not sure how to do the dynamic WHERE clause.
I have a column that contains [eventType] as follows
HAIL
TORNADO
FUNNEL
DOWNBURST
I want to pass to the Proc parameters to filter on [eventType] depending on weather check boxes on the web page are selected.
EXEC MyProc @_hail =1, @_tornado =1, @_ funnel=0, @ _downburt=0
MyProc
@_hail BIT,
@_tornado BIT,
@_ funnel BIT,
@ _downburt BIT
SELECT * from eventsTable
WHERE [eventType] = HAIL
OR [eventType] = TORNADO
I am not sure how to do the dynamic WHERE clause.
Comment