CREATE VIEW dbo.arg_history_view (
product,
object_uuid,
table_name,
field_name,
hsinstnc,
object_type,
hsaction,
hstblbl,
hsfddefi,
hsfilbl,
hsovalue,
hsvalue,
hsotext,
hstext,
hsadinfo,
creation_user,
creation_date,
last_update_user,
last_update_date,
version_number)
AS
select
'uapm' as product,
arg_history.object_uuid,
arg_history.table_name,
arg_history.field_name,
arg_history.hsinstnc,
arg_history.object_type,
arg_history.hsaction,
arg_history.hstblbl,
arg_history.hsfddefi,
arg_history.hsfilbl,
arg_history.hsovalue,
arg_history.hsvalue,
arg_history.hsotext,
arg_history.hstext,
arg_history.hsadinfo,
arg_history.creation_user,
arg_history.creation_date,
arg_history.last_update_user,
arg_history.last_update_date,
arg_history.version_number
from dbo.arg_history
union
select
'cmdb',
nr_com.com_par_id,
'ca_owned_resource',
nr_com.attr_name,
0,
11,
'update',
'asset',
-1,
nr_com.attr_name,
null,
null,
nr_com.old_value,
nr_com.new_value,
nr_com.com_comment,
'not uapm',
null,
nr_com.com_userid,
nr_com.com_dt,
0
from dbo.nr_com
GO