CREATE view usd_v_lsg as
select G.group_uuid as objectid, G.version_number+1 as version,
G.creation_user as creation_user, G.evaluation_uuid as qtask,
0x00000000000000000000000000000000 as aux, 0x00000000000000000000000000000000 as aux2,
5 as type, 0x00000000 as attributes, G.label as name, G.description as comment,
G.creation_date as credate, G.creation_date as cretime, G.last_update_date as chdate,
G.last_update_date as chtime, 0 as propflag, '' as qcalendar, G.eval_freq as qevalrate,
0 as qnextevaldate, 0 as qnextevaltime, G.last_eval_date_time as qevaldate,
G.last_eval_date_time as qevaltime, 0x00000000000000000000000000000000 as qtemplfold,
0 as qtype, 0 as state, 0 as seal, 0 as var, '' as auxtext0, '' as auxtext1, '' as auxtext2,
'' as auxtext3, G.query_uuid as queryid, G.evaluation_location as evaluation_location,
G.group_flag as group_flag, G.group_system as group_system, G.group_uuid
from ca_group_def G
where G.member_type = 4
GO
GRANT SELECT ON [dbo].[usd_v_lsg] TO [ams_group]
GRANT SELECT ON [dbo].[usd_v_lsg] TO [ca_itrm_group]
GRANT SELECT ON [dbo].[usd_v_lsg] TO [ca_itrm_group_ams]
GRANT SELECT ON [dbo].[usd_v_lsg] TO [upmuser_group]
GO