I am trying to build a procedure that is generic enough that I may use it to query several tables with a single procedure. Most of the tables have pretty much the same columns.
I tried the following but I keep getting an error...
.
.
.
from
CASE @view2use
WHEN 'view1' THEN 'view1_vw'
WHEN 'view2' THEN 'view2_vw'
WHEN 'view2' THEN 'view3_vw'
WHEN 'view4' THEN 'view4_vw'
END
where
.
.
.
Is there a way for me to accomplish this ?
I tried the following but I keep getting an error...
.
.
.
from
CASE @view2use
WHEN 'view1' THEN 'view1_vw'
WHEN 'view2' THEN 'view2_vw'
WHEN 'view2' THEN 'view3_vw'
WHEN 'view4' THEN 'view4_vw'
END
where
.
.
.
Is there a way for me to accomplish this ?