I'm trying to pull in data from our CMDB into VCM. We've linked the SQL servers and my query below works as expected in SQL Management Studio. Since our CMDB doesn't have the machine_id that I need for the dynamic query, I use an inner join based on the server name. I get two errors which seem to be conflicting based on if I join to a table or a view. If I try to join with a table, I get an error that I must reference a view. If I try to join with a view, I get an error that I cannot reference a system view. Does anyone know which non-system view I'm supposed to reference?
This shows my attempt to join with a table:
select @Return_Value = (
select b.LOCATION_STATE
from dbo.ecm_dat_machine_environment_flat a
Inner JOIN
[CMDBSvr].[SMPROD_SNAP].[dbo].[CUSTOM_VCM_SERVER_METADATA] b
on a.machine_name = b.title
where machine_id = @machine_id
)
This is the error I receive "Your SQL must not contain a reference to data directly. Please only select valid VCM Views"
This is my attempt to join with a view:
select @Return_Value = (
select b.LOCATION_STATE
from dbo.ecm_sysview_machines a
Inner JOIN
[CMDBSvr].[SMPROD_SNAP].[dbo].[CUSTOM_VCM_SERVER_METADATA] b
on a.machine_name = b.title
where machine_id = @machine_id
)
This is the error I receive "Your SQL must not contain a reference to any VCM system views"