
[dbo].[usm_vw_offering_path]
create view usm_vw_offering_path as
select
usm_offering.*,
dbo.usm_fn_get_offering_path(usm_offering.offering_id) as offering_path,
case when charindex('/',dbo.usm_fn_get_offering_path(usm_offering.offering_id)) > 0
then substring(dbo.usm_fn_get_offering_path(usm_offering.offering_id),1,charindex('/',dbo.usm_fn_get_offering_path(usm_offering.offering_id))-1)
else
dbo.usm_fn_get_offering_path(usm_offering.offering_id) end as service_folder
from usm_offering
GO
GRANT SELECT ON [dbo].[usm_vw_offering_path] TO [usmgroup]
GO